web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Format Ms Form Json re...
Power Automate
Answered

Format Ms Form Json response to import in PowerBi streaming dataset

(0) ShareShare
ReportReport
Posted on by

Hi Forum,

 

I hope you guys are doing well. I'm struggling with the MS Form Json response and I hope you guys can help me finding a solution.

 

I created a MS Form that gives the next output in Power Automate: (Response)

 

{
 "responder": "chris@test.com",
 "submitDate": "10/31/2023 6:44:11 PM",
 "r9922aea683814bd492f0fed90e8f8a3b": "test",
 "r74cef0023a0b4f6585b2a7e9b960ab15": "test",
 "rceb3def1a94d4d40ac31c3c38ae1cf1d": "test",
 "rdc1ebc4aeff14fe6bd6d6e33b5704304": "test",
 "r609e044438e64e10be0c003250ad1b43": "",
 "re66ff8f03dbc42089e5ef7331c11be15": "",
 "redf42a5ba7f041229d8b6f3478d3f85a": "FR",
 "re876c4d54fc54f2f89088ca3b65a9265": "Yes",
 "r5bbb9eb4a2fe416abb9eb5e7fe590337": "Yes - Use of pro",
 "r2b694e30a839485ba912f6be78f4dfbf": "Auth system",
 "rf7dc56c06ca94e04aa3028a1d1375cfb": "[{\"name\":\"Background_Chris.png\",\"link\":\"https://my.sharepoint.com/personal/chris/Documents/Apps/Microsoft%20Forms/TestForm/Question%201/Background_Chris%202.png\",\"id\":\"01YJFOYFSOHNN2G6N55BDI3S4EFI6XHFU2\",\"type\":null,\"size\":442712,\"referenceId\":\"01YJYTRYTVUYQ6UPBMVZXZEXQYMKDWJ3K2\",\"driveId\":\"b!tL9edbqlsTEeZe6tq_1zMkK7MNBV2EFFmyWc_vX9ERT4EM4SCw3aSJ8kdIVz72Ce\",\"status\":1,\"uploadSessionUrl\":null}]",
 "rf307688714b64d2bb1295475dfb3b7d9": "test",
 "rbc3b1b5ed28d4a6ba0e4b3022dbec3fe": "Paper",
 "r9b32c1657b214e3aabb064e58fd6acad": "[\"Badges\",\"Opening\",\"Phone\"]"
}

 

 

I plan to have more questions and other Forms in the future, so I'm looking for something dynamic to loop through and insert in a PowerBi streaming dataset. The outcome should be an array that I can iterate through. (with or without the responder and submitDate)

[
 {
 "Question" :"r9922aea683814bd492f0fed90e8f8a3b",
 "Respons" :"test"
 },
 {
 "Question" :"r74cef0023a0b4f6585b2a7e9b960ab15",
 "Respons" :"test"
 },
 {
 "Question" :"rceb3def1a94d4d40ac31c3c38ae1cf1d",
 "Respons" :"test"
 },
 {
 "Question" :"rdc1ebc4aeff14fe6bd6d6e33b5704304",
 "Respons" :"test"
 },
 {
 "Question" :"r609e044438e64e10be0c003250ad1b43",
 "Respons" :""
 },
 {
 "Question" :"re66ff8f03dbc42089e5ef7331c11be15",
 "Respons" :""
 },
 {
 "Question" :"redf42a5ba7f041229d8b6f3478d3f85a",
 "Respons" :"FR"
 },
 {
 "Question" :"re876c4d54fc54f2f89088ca3b65a9265",
 "Respons" :"Yes"
 },
 {
 "Question" :"r5bbb9eb4a2fe416abb9eb5e7fe590337",
 "Respons" :"Yes - Use of pro"
 },
 {
 "Question" :"r2b694e30a839485ba912f6be78f4dfbf",
 "Respons" :"Auth system"
 },
 {
 "Question" :"rf7dc56c06ca94e04aa3028a1d1375cfb",
 "Respons" :"[{\"name\":\"Background_Chris.png\",\"link\":\"https://my.sharepoint.com/personal/chris/Documents/Apps/Microsoft%20Forms/TestForm/Question%201/Background_Chris%202.png\",\"id\":\"01YJFOYFSOHNN2G6N55BDI3S4EFI6XHFU2\",\"type\":null,\"size\":442712,\"referenceId\":\"01YJYTRYTVUYQ6UPBMVZXZEXQYMKDWJ3K2\",\"driveId\":\"b!tL9edbqlsTEeZe6tq_1zMkK7MNBV2EFFmyWc_vX9ERT4EM4SCw3aSJ8kdIVz72Ce\",\"status\":1,\"uploadSessionUrl\":null}]"
 },
 {
 "Question" :"rf307688714b64d2bb1295475dfb3b7d9",
 "Respons" :"test"
 },
 {
 "Question" :"rbc3b1b5ed28d4a6ba0e4b3022dbec3fe",
 "Respons" :"Paper"
 },
 {
 "Question" :"r9b32c1657b214e3aabb064e58fd6acad",
 "Respons" :"[\"Badges\",\"Opening\",\"Phone\"]"
 }
 ]

 

 

I have tried playing with xpath, without results, extracting the value works but not the node name. The closest I have been is following the next tutorial https://www.youtube.com/watch?v=SF7x2MRCRsQ that explains how to convert to a CSV table first and then back to JSON, but because the values contain comma's it's not giving the right result. I tried replacing them but I can't distinguish the JSON and values commas.

 
I really hope you guys can point me in the right direction.
 
Thank you in advance and looking forward.
 
Chris
Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @ChrisBI ,

     

    Please try this

    vxiaochenmsft_0-1698802555491.png

    vxiaochenmsft_1-1698802565463.png

    vxiaochenmsft_2-1698802581242.png

    vxiaochenmsft_3-1698802593526.png

    split(split(body('Create_CSV_table'),decodeUriComponent('%0D%0A'))?[0],',')
    vxiaochenmsft_4-1698802609933.png
    item()
    variables('var')?[item()]
    vxiaochenmsft_5-1698802644981.png

     

    Best Regards,

    Wearsky

  • CH-22072116-0 Profile Picture
    on at

    Hi @v-xiaochen-msft 

    I'm still stuck but wwaawww it's going in the right direction !

     

    I get the next error on the SELECT step for the next expression: variables('var')?[item()] :

     

    InvalidTemplate. The execution of template action 'Select_-_Create_searchable_array' failed: The evaluation of 'query' action 'where' expression '{ "questionId": "@item()", "response": "@variables('varResponsesJsonArray')?[item()]" }' failed: 'The template language expression 'variables('varResponsesJsonArray')?[item()]' cannot be evaluated because property 'responder' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

     

    Removing the Respons generates a nice JSON with the questions 😉

     

    Not sure what I did wrong but must be something stupid.

     

    Thanks

    Chris

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @ChrisBI ,

     

    If you don't care about the 'responder' column, you can remove it from your object first.

     

    https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#removeproperty

     

    After removing this column, I think it will work.

     

    Best Regards,

    Wearsky

  • CH-22072116-0 Profile Picture
    on at

    Hi @v-xiaochen-msft 

     

    Thanks for your quick response, I removed the "responder" but now he's complaining about the next field "submitDate"

     

    Not sure what's wrong with the SELECT and how you succeed to isolate the value using : variables('var')?[item()] 

     

    Error I get now:

    InvalidTemplate. The execution of template action 'Select_-_Create_searchable_array' failed: The evaluation of 'query' action 'where' expression '{ "questionId": "@item()", "response": "@outputs('Compose_-_Create_an_array_of_the_responses')?[item()]" }' failed: 'The template language expression 'outputs('Compose_-_Create_an_array_of_the_responses')?[item()]' cannot be evaluated because property 'submitDate' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

     

    Thanks

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @ChrisBI ,

     

    Please share some screenshots.

     

    Best Regards,

    Wearsky

  • CH-22072116-0 Profile Picture
    on at

    Hi @v-xiaochen-msft 

     

    My execution

     

    ChrisBI_0-1698831311568.png

     

     

    ChrisBI_1-1698831351187.png

     

     

    ChrisBI_2-1698831380575.png

     

    In the next step, when I remove the expression from the response key then I get the desired JSON but with empty value on response. When adding the expression from your solution it crashes: variables('varJsonResponsesArray')?[item()]

     

    ChrisBI_5-1698831480350.png

     

     

  • CH-22072116-0 Profile Picture
    on at

    Hi @v-xiaochen-msft 

     

    I found my error... I had to use an extra variable to store my response as object. Solves the issue.

     

    Thank you very much for your patience !

     

    Take care.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227

#2
David_MA Profile Picture

David_MA 204 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 177

Last 30 days Overall leaderboard