cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Extracting file information from MS Form's "File Upload"

I have a Microsoft Form with a dozen questions that all allow for multiple file uploads.  These files are uploaded to a SharePoint site.  Upon completion of the form, I'm trying to send an email with links to the forms loaded into SharePoint.  I attempted to follow the following post:

 

https://powerusers.microsoft.com/t5/Building-Flows/Working-with-files-from-the-Forms-quot-File-Uploa...

 

My problem is, I can't figure out how to convert the output of the Parse JSON step into a string array using only the "name" and "link" elements, nor how I can dynamically reference those array components in the body of the email. 

3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: Extracting file information from MS Form's "File Upload"

Hi again!

I think you are following similar steps as here, right?

https://www.bythedevs.com/post/working-with-date-time-data-of-excel-in-power-automate

 

So I am assuming more complex scenario... in your form you offer the possibility to upload files through two different questions. In the Forms Survey I just implemented as example, questions are called 'Release Notes' and 'Self Cetification Test Results'. Both of these questions allow multiple attachments upload (up to 4 in my example).

Flow_FormsMultiQuestion.png

Now in the Flow I need an array variable, I just called it formsLinks:

Flow_FormsAttachmentsShareLink0.png

I opted to process in paralel both responses (please refer to 'Condition Self Certification Test Starus', and 'Condition Release Notes'), but you can process them sequentially. If you just have one question for file upload, then just need one.

 

Now the processing I do inside any of these Conditions is the following:

Flow_FormsAttachmentsShareLink1.png

Last Condition verifies that variable 'formsLinks' is not empty. ON the true branch I build an HTML table so I can add it to the email body.

HTML has two columns: FileName and Link. If you need more columns (i.e. Question NAme, Submission Date Time, email of the requestor) just add them in the 'Append to array'.

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Dual Super User
Dual Super User

Re: Extracting file information from MS Form's "File Upload"

Hi again!

 

"Regarding your last comment about OneDrive, I have moved this form to a Microsoft Team site, so the form submission stores the uploaded files on the Team's SharePoint, and the recipients of the email are all members of that Team.  Therefore, there is no need to email the attachments since a link works fine. "

Thanx for sharing! Very valuable info

 

Now on your last challenge, plesa have a look to this old dirty but also efficient way to add hyperlinks to an HTML table in Flow:
https://powerusers.microsoft.com/t5/Building-Flows/How-to-format-link-properly-in-Create-HTML-table-...
Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Community Support
Community Support

Re: Extracting file information from MS Form's "File Upload"

 

Hi @JimSutt ,

 

Please try to use the following expression to format hyperlink:

replace(replace(replace(body('Create_HTML_table'), '&lt;', '<'), '&gt;', '>'), '&quot;', '"')

Image reference:

87.PNG

Hope this helps.

 

Best Regards, 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Highlighted
Dual Super User
Dual Super User

Re: Extracting file information from MS Form's "File Upload"

Hi!
"I have a Microsoft Form with a dozen questions that all allow for multiple file uploads"
Do you allow upload of multiple files in a single question? Or do you have several questions all of them requesting to upload multiple files?
Thanx!


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Dual Super User
Dual Super User

Re: Extracting file information from MS Form's "File Upload"

Hi again!

I think you are following similar steps as here, right?

https://www.bythedevs.com/post/working-with-date-time-data-of-excel-in-power-automate

 

So I am assuming more complex scenario... in your form you offer the possibility to upload files through two different questions. In the Forms Survey I just implemented as example, questions are called 'Release Notes' and 'Self Cetification Test Results'. Both of these questions allow multiple attachments upload (up to 4 in my example).

Flow_FormsMultiQuestion.png

Now in the Flow I need an array variable, I just called it formsLinks:

Flow_FormsAttachmentsShareLink0.png

I opted to process in paralel both responses (please refer to 'Condition Self Certification Test Starus', and 'Condition Release Notes'), but you can process them sequentially. If you just have one question for file upload, then just need one.

 

Now the processing I do inside any of these Conditions is the following:

Flow_FormsAttachmentsShareLink1.png

Last Condition verifies that variable 'formsLinks' is not empty. ON the true branch I build an HTML table so I can add it to the email body.

HTML has two columns: FileName and Link. If you need more columns (i.e. Question NAme, Submission Date Time, email of the requestor) just add them in the 'Append to array'.

 

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Dual Super User
Dual Super User

Re: Extracting file information from MS Form's "File Upload"

Oops!

One final thought. Please bear in mind that, uploaded files are stored in your OneDriveForBusiness, meaning the links I am currently injecting in the HTML Table are OneDriveForBusiness links. If you wish to send this email to your teammates, you need to manually assign permissions to anyone else to access these files.

Or... move the files into a Sharepoint Library, so you can use action block 'Grant access to item or file' to automatically grant permissions. If this last one is your goal, then you need to share Sharepoint links instead

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: Extracting file information from MS Form's "File Upload"

@efialttes, thank you for your response!  Your approach covers most of what I was looking for.  However, my goal is not to keep the filename and link as separate columns in the email, but rather list the filenames as links in a single column.  What I attempted to do with your solution was to replace the "value" in the "Append to array variable" with a single column.  Since it's still a JSON object, I'm forced to give it a column heading, so I'm using: 

ImageUpload-APPEND.png

Trouble is, when inserted as HTML, the tags are converted to strings.  

 

While I have multiple questions that each allow multiple attachments, I created a simple form for testing your solution.  Here's what I created:

 

ImageUpload1.png

ImageUpload2.png

ImageUpload3.png

ImageUpload4.png

 

After the "Create HTML Table" step, I insert the output into the body of the email.  I would prefer not to include the the "Filename" header as I'm inserting this HTML table into a larger table, but I can live with it.  However, I would prefer the email to include just the image filenames as links to the files.

 

Regarding your last comment about OneDrive, I have moved this form to a Microsoft Team site, so the form submission stores the uploaded files on the Team's SharePoint, and the recipients of the email are all members of that Team.  Therefore, there is no need to email the attachments since a link works fine.  

Highlighted
Dual Super User
Dual Super User

Re: Extracting file information from MS Form's "File Upload"

Hi again!

 

"Regarding your last comment about OneDrive, I have moved this form to a Microsoft Team site, so the form submission stores the uploaded files on the Team's SharePoint, and the recipients of the email are all members of that Team.  Therefore, there is no need to email the attachments since a link works fine. "

Thanx for sharing! Very valuable info

 

Now on your last challenge, plesa have a look to this old dirty but also efficient way to add hyperlinks to an HTML table in Flow:
https://powerusers.microsoft.com/t5/Building-Flows/How-to-format-link-properly-in-Create-HTML-table-...
Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Highlighted
Community Support
Community Support

Re: Extracting file information from MS Form's "File Upload"

 

Hi @JimSutt ,

 

Please try to use the following expression to format hyperlink:

replace(replace(replace(body('Create_HTML_table'), '&lt;', '<'), '&gt;', '>'), '&quot;', '"')

Image reference:

87.PNG

Hope this helps.

 

Best Regards, 

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Dual Super User
Dual Super User

Re: Extracting file information from MS Form's "File Upload"

@JimSutt 

I guess we got a happy ending, right? If so, Congrats!

 

Please remember mark this topic as "Solved" by clicking "Accept as a solution". This way other community members facing this same problem in the future have the chance to find a solution faster. Please note you can even select several replies as as 'Solution', even from different community members!

Flow_AcceptSolution.png

Thanx for your contribution to keep this community great!

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Highlighted
Helper II
Helper II

Re: Extracting file information from MS Form's "File Upload"

Thank you @efialttes and @v-bacao-msft for your help!!!  You're both awesome!!!

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (8,606)