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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Dynamically parsing to...
Power Automate
Suggested Answer

Dynamically parsing to JSON a subset of forms questions

(1) ShareShare
ReportReport
Posted on by 2
I have a subset of questions names in a microsft forms which contain attachments
 
How do I acces them inside a for each stament to parse them as jsons
Categories:
I have the same question (0)
  • Suggested answer
    trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at
    Hi,
     
    Here's some framework to help you work with attachments from a Form.  In my example, I am getting them and sending them as an attachment by email.
     
     
     
    Sample Form:
     
     
     
     
     
    The trigger and get response details are self-explanatory.  Next create an array variable 'attachments1'
     
     
     
     
    Next in my example, the file upload question is optional.  So here I check if the question was submitted in a condition.
     
     
     
    Next I will use Parse JSON.  Here I am using the json from the output of the get response details for the individual question.  A lot of people ask where to get this while building though.  What I typically do when working with Form attachments is after the trigger and get response details, SAVE and submit a test run.  Now you will have a JSON payload to work with when you get to this step.
     
    Ok, so I submitted a test Form after adding the trigger and get response details.  Look at the output and copy the json for the file upload question.  It starts with a [ and ends with a ].  
     
     
     
    You will use the example to build your schema below.
     
     
    So here, I am pointing to the question that contains the file upload in the content field.  Now, with the JSON output from the specific question copied, click on 'Use sample payload to generate schema', shown above.  Paste in your example.  That's going to give you something like this above.
     
    The next step is to add Get file content action (do not add apply to each manually), it will automatically be added for you.
     
     
    When you add the dynamic content Body ID in the File field, it will automatically wrap itself in an apply to each, because your file upload question may allow more than one attachment to be uploaded.
     
     
    Next inside the apply to each, add Append to array variable. shown below.
     
     
    Last step, outside of the apply to each, add a send email (in this example), and format like this shown below.
     
     
    So in my example, remember I added two files in my file upload question.  Notice below my apply to each has run loops in the output.  So each time I run through the loop, using the parse json schema (which exposes the dynamic content for the upload details), I get the file content and append the data to my array.
     
     
     
    Regardless of what you end up doing with your attachments, this is a good demo of the parse json and apply to each process and hope this helps!
     
     
     
    ------------------------------------------------


    If this was helpful, please like and/or mark as a verified answer to help others find this too!


    Always glad to help! 💯💯💯💯💯

    Tom 

    Follow me on LinkedIn - Thomas Rice, PMP | LinkedIn

     


     
     
     
     
  • trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at
    Hey there!
     
    I am following up on this post dynamically parsing to json a subset of forms questions  in this category building flows from 11/07/2024.  I know the post is a little older, but it is a common question here so wanted to take a moment and follow-up. I see there have been 1 replies and 1 likes and asking if your question has been answered.  If so, please help the community out by completing one or more of the following actions!  Thanks in advance!
     
    Easy as 1-2-3 ‼️💯⭐😎🆒🙏
     
    1) Mark a reply as a verified answer - this is essential, and it helps others with the same general question find this thread. ✅
    2) You can also mark one of more replies as a verified answer.  Please take a moment and give the author credit for volunteering their time. ✌️
    3) Like one or more replies.  Kudos always greatly appreciated! 👍
     
    Pro tip:  if you found your own solution or workaround, feel free to add a reply to your own post and mark it as the solution too!  The goal is to get this thread marked with a verified answer by anyone that finds one or more replies helpful!
     
    Again, thanks in advance for reading and responding, always glad to help!  Tom 💯💯💯💯💯
  • trice602 Profile Picture
    15,404 Super User 2025 Season 2 on at
    If I can help with anything else please let me know or tag me in a future post, I enjoy reading and answering questions.  Always glad to help!  Tom 💯💯💯💯💯

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard