Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 93MU16DmBTKdyaXeoih7+i
Power Automate - Building Flows
Answered

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

Like (0) ShareShare
ReportReport
Posted on 19 Apr 2020 02:00:33 by 203

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-Upload-quot-question/td-p/427353

 

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. 

  • JimSutt Profile Picture
    203 on 20 Apr 2020 at 12:27:01
    Re: Extracting file information from MS Form's "File Upload"

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

  • efialttes Profile Picture
    14,756 on 20 Apr 2020 at 09:26:19
    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!

     

  • Verified answer
    v-bacao-msft Profile Picture
    on 20 Apr 2020 at 06:54:05
    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, 

  • Verified answer
    efialttes Profile Picture
    14,756 on 19 Apr 2020 at 22:35:03
    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-in-Ms-flow/td-p/427180
    Hope this helps

  • JimSutt Profile Picture
    203 on 19 Apr 2020 at 22:15:23
    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.  

  • efialttes Profile Picture
    14,756 on 19 Apr 2020 at 09:40:25
    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

  • Verified answer
    efialttes Profile Picture
    14,756 on 19 Apr 2020 at 09:39:19
    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

  • efialttes Profile Picture
    14,756 on 19 Apr 2020 at 08:29:52
    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!

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard