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

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Sample JSON for Files ...
Power Automate
Answered

Sample JSON for Files attached to MS Forms

(0) ShareShare
ReportReport
Posted on by 10

Hi All,

 

Am trying to use Parse JSON control for files attached to MS Form to attach them to an email. Am not able to supply a sample payload to generate the JSON.

 

My MS Forms will have 3 files attached to the same question and file type could be one of doc, xlsx, ppt, pdf or image.

 

When I run below sample flow

 

dchow18_0-1633704987241.png

 

I get this in run history but no sample load

 

dchow18_1-1633705178963.png

 

I did look at this question https://powerusers.microsoft.com/t5/General-Power-Automate/Flow-Parse-JSON-use-a-sample-payload-to-generate-schema/td-p/329266 but couldn't understand what the data attribute should be for my files and if its possible to do this when am not sure what the incoming file type will be for sure. It could be any of 4/5 formats.

 

If someone can help, would be great.

 

Thanks,

Categories:
I have the same question (0)
  • eric-cheng Profile Picture
    5,171 on at

    Hi @dchow18 ,

     

    With MS Forms, the attachments are stored in OneDrive.

     

    Here is a blog to show you how you can email the files.

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

     

     

  • Verified answer
    CFernandes Profile Picture
    8,482 Most Valuable Professional on at

    Hey Mate @dchow18,

     

    The blog provided by @eric-cheng  is a great starting point. 

     

    If you are someone who like to follow video tutorial you can have a look at https://www.youtube.com/watch?v=kNC8q6NzBEc 

     

    I myself did a video tutorial on - Convert Microsoft Forms responses with attachments to PDF - https://www.youtube.com/watch?v=YDWpGW1BaBU 

     

    Blog post - https://clavinfernandes.wordpress.com/2020/01/01/convertmerge-microsoft-form-attachments-to-pdf/ 

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • dchow18 Profile Picture
    10 on at

    Thanks @eric-cheng , @CFernandes  for the solutions, I tried this but am getting below error:

     

    dchow18_0-1634153827323.png

     

    dchow18_1-1634153842382.png

     

    dchow18_2-1634153890876.png

     

    When I run it, I face the below error:

     

    dchow18_3-1634153913965.png

     

    Can you help with this?

     

    Regards,

  • eric-cheng Profile Picture
    5,171 on at

    Hi @dchow18 ,

     

    In the Append to Array action, can you please review the value with the below.  It needs to include Name and ContentBytes.  You can simply change source_file_name to Name and source_file_content to ContentBytes

     

    ericcheng_0-1634168447809.png

     

    --------------------------------------------------------------------------
    If I have answered your question, please mark my post as a solution
    If you have found my response helpful, please give it a thumbs up

    Connect on LinkedIn

     

  • CFernandes Profile Picture
    8,482 Most Valuable Professional on at

    Hey @dchow18 

     

    @eric-cheng has formatted the JSON Correctly - 

     

    {
     "Name": "<Name>,
     "ContentBytes": "<File Content>"
    }

    In my blog I use Muhimbi Merge action and that is the reason I am using a different array structure.

     

    If you do not get correct results, I would request you to decorate -  the File_Content with base64ToBinary() 

     

    base64ToBinary(body('Get_file_content')['$content'])

     

    {

    "Name": <Name>,

    "ContentBytes": base64ToBinary(body('Get_file_content')['$content'])

    }

     

    Keep us posted on how things go!!!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

  • dchow18 Profile Picture
    10 on at

    Thanks @eric-cheng , @CFernandes . This was helpful and it worked.

  • CFernandes Profile Picture
    8,482 Most Valuable Professional on at

    Wohooo... We are glad that we could assist you 😊

  • geddb Profile Picture
    109 on at

    Hi  &  @CFernandes & @eric-cheng ,

     

    I hope this is the appropriate place for me to post my question. If not, please direct me to the right place.

    I am completely new to JSON and I'm trying to convert records stored in a proprietary app and parse them using JSON to a SharePoint List using a Power Automate Flow. The proprietary app has a field that stores multiple attachments (mostly emails).

    It's all working fine but when the flow gets to the 'Apply To Each' action which checks for multiple attachments and loops through the attachments, it fails because my Split() function is expecting a string but is getting an array. This is the error I get:

    geddb_0-1691135116984.png

     

    My Split() function looks like this:

    geddb_1-1691135116986.png

     

     

    Where 'Attachments' is the name of the proprietary application field and varAttachmentCount is a loop counter in Power Automate.

     

    Here is the JSON object relating to attachments:

    geddb_2-1691135116987.png

     

    I have had to create a 'webhook' in the proprietary application which is named 'upload_attachments' and this was the JSON code recommended to me by others.

     

    I've tried changing the property type from 'array' to string in the JSON but that didn't work either.

     

    I'm hoping this provides you with enough information to point me in the right direction. Any assistance you can give me will be appreciated immensely. I have been going around in circles for days.

     

    Sincere thanks in advanced.

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard