Azure Logic Apps and Microsoft Forms - Get field descriptors

2.2k views Asked by At

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??

2

There are 2 answers

0
felixmondelo On BEST ANSWER

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"
 }
5
SwethaKandikonda On

These are field identifiers. You can retrieve them directly from the Dynamic content of Get response details.

enter image description here

Alternatively, you can build your own JSON body(in your case Get response details) from Compose connector.