Mar 14 2018 05:48 PM
Earlier this year, Microsoft announced the Likert survey question type in Microsoft Forms. A Likert captures multiple choice question on a scale.
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:
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:
Hope you find this trick useful.
Apr 16 2018 09:01 AM
Apr 20 2018 10:03 AM
... 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
May 05 2018 06:29 AM
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
Aug 18 2018 08:40 PM
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
Aug 20 2018 01:16 PM
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.
Aug 26 2018 09:55 AM
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.
Sep 12 2018 04:39 AM
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.
Jan 27 2021 07:49 AM
@Haniel Croitoru Any idea how to do the same thing in a SharePoint Online list? The fields are text (long form). Ivor