Parsing Microsoft Forms Likert questions using Flow

Learn Expert

Earlier this year, Microsoft announced the Likert survey question type in Microsoft Forms.  A Likert captures multiple choice question on a scale.  

 

Likert.PNG

When the survey responses are loaded into a Flow, each of the Likert options is stored in a separate dynamic content value as shown below:

 

DynamicContent.png

 

 

Looks simple, but there's a catch.  Each of the values is actually captured as a JSON object rather than the simple response.  To get to the actual value, I had to leverage the Parse JSON action to convert the value into properly structured JSON.  The format of JSON payload is as follows:

 

{
  "id": 5,
  "order": 1.0,
  "answerOrder": 0,
  "displayText": "Orange Juice",
  "invalid": false,
  "url": null,
  "description": null,
  "symbol": null,
  "symbolColor": null,
  "isCustomChoice": false,
  "customProperties": "{\"IsGenerated\":true}",
  "key": null,
  "image": {
    "altText": null,
    "contentType": null,
    "fileIdentifier": null,
    "originalFileName": null,
    "resourceId": null,
    "customProperties": null,
    "resourceUrl": null
  }
}

 

Then, to access each of the values, I leverage an expression for the Parse JSON actions.  For example, to get the breakfast drink, I used the expression below

 

body('Parse_Breakfast')['displayText']

Here's what my flow looks like to parse out the Breakfast, Lunch, and Dinner drink responses:

 

Parse.PNG

 

Hope you find this trick useful.

9 Replies
What is the content in 'Parse Breakfast' and others ?
also the schema ?

... just in case someone else is looking for this... for the schema, you just need to select "Use sample payload to generate schema", and copy and paste from the JSON output you may have (similar to the example included in the post). 

For the "Content" field you should use the corresponding field from the form

I did not you clearly, I need to extract the value of Likert from the mircosoft form while forwarding the notification using Microsoft flow.

 

I did not get you in the later part. Please explain me in brief

Sorry for not clarifying in my original post.  The Parse_Breakfast is the JSON output for the Breakfast value using the following schema:

 

{
    "type": "object",
    "properties": {
        "id": {
            "type": "number"
        },
        "order": {
            "type": "number"
        },
        "answerOrder": {
            "type": "number"
        },
        "displayText": {
            "type": "string"
        },
        "invalid": {
            "type": "boolean"
        },
        "url": {},
        "description": {},
        "symbol": {},
        "symbolColor": {},
        "isCustomChoice": {
            "type": "boolean"
        },
        "customProperties": {
            "type": "string"
        },
        "key": {},
        "image": {
            "type": "object",
            "properties": {
                "altText": {},
                "contentType": {},
                "fileIdentifier": {},
                "originalFileName": {},
                "resourceId": {},
                "customProperties": {},
                "resourceUrl": {}
            }
        }
    }
}

Here's what the Flow looks like

Likert.PNG

 

 

 

Great blog, how would you do something similar with a multi answer question in forms?  Right now it comes in as one string (csv) that contains all the answers that were checked.  I need to split those out and treat them as separate objects.

I figured it out.  The multi selection question returns a json string array.  If you parse the json (action/data operations/parse JSON) and then apply to each.

Hi Gregory, 

 

Would you be able to share the JSON array you used to extract the individual multiple choice response options? I have a similar problem where there are certain responses from a multiple choice question I want to display but some I do not so being able to omit them via JSON seems ideal.

 

Thanks in advance.

@Haniel Croitoru Any idea how to do the same thing in a SharePoint Online list? The fields are text (long form). Ivor