cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dchow18
New Member

Sample JSON for Files attached to MS Forms

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-g... 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,

1 ACCEPTED SOLUTION

Accepted Solutions
CFernandes
Super User
Super User

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!

View solution in original post

7 REPLIES 7
eric-cheng
Solution Sage
Solution Sage

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

 

 

CFernandes
Super User
Super User

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!

View solution in original post

dchow18
New Member

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
Solution Sage
Solution Sage

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

 

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
New Member

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

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

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,291)