azure-logic-appsmicrosoft-forms

Azure Logic Apps and Microsoft Forms - Get field descriptors


I have a Logic App that retrieves the responses submitted by the users through Microsoft Forms.

When I see the Logic App Run, I can see the descriptor for each field (MuleSoft, IoT & Integration, Encuesta de tecnologías, ...), for example:

enter image description here

But in the "Show raw outputs" I can't see those fields, I get an identifier (rcb6ccf0fc9e44f74b44fa2715fec4f27, ...):

enter image description here

How I can retrieve those descriptors??


Solution

  • The solution is to add a 'Send an HTTP request to SharePoint' action to get the details of the form.

    enter image description here

    The Site Address is: https://forms.office.com The Method is: GET The Uri is: /formapi/api/forms('')?select=id,title,questions&$expand=questions($expand=choices)

    This returns a JSON with all the questions and for each question the ID, Title and more info about the question.

    We can implement a loop through these questions and with each ID, extract the response from the Microsoft Forms:

    foreach": "@body('Send_an_HTTP_request_to_SharePoint')['questions']"
    

    And Compose the result:

    "Compose": {
       "inputs": {
          "Id": "@{items('For_each')['id']}",
          "Name": "@items('For_each')['title']",
          "Value": "@{body('Get_response_details')[item()['id']]}"
       },
       "runAfter": {},
       "type": "Compose"
     }