Skip to main content

Notifications

Power Automate - General Discussion
Answered

Edited: Sending Several Documents Uploaded in Forms as Attachments in ONE email

(0) ShareShare
ReportReport
Posted on by 12

Please note: this works when ONE Form question allows respondents to upload multiple files.  If you have multiple separate form questions where respondents can upload attachments, this is probably not the simple solution you're looking for.

 

Hello,

Situation:

My office gets lots of requests to begin a contract process which I route to Supply Chain.  Rather than getting emails that I have to forward, I created a New Contract Intake Form. 

1. The user answers some questions about their vendor and then uploads up to 3 supporting documents.

2. The form is routed to two contract specialists via email using a very basic power automate flow pictured below:

rara_0-1646233902520.png

 

Issues:

1. The Supply Chain email recipients cannot view the links to the uploaded documents.  (Do I grant them access to the Form beforehand?  Do I grant them access to the folder in "Apps" that contains the uploads?  How do I make so that each time a new form is completed and a new document is uploaded, the link in the email works for the email recipients without me having to grant permission each time.)

 

2.  Less importantly, how to I attach the link to a phrase like "Uploaded Document 1" etc.?  Right now links look like messy gibberish at the bottom of  the email (see below). 

 

rara_0-1646313540631.png

 

 

Thank you!

Categories:
  • Verified answer
    rara Profile Picture
    rara 12 on at
    Re: Sharing Uploaded Documents via Forms

    Success! I was finally able to solve this problem on my own after MONTHS of watching youtube videos.  Here is my flow:

     

    1. Respondents answer an intake Form and can upload up to 4 supporting documents in the Form.

    2. A row is added into an excel spreadsheet so that responses are a) cumulative and b) the team can add columns and other comments.

    3. The responses are routed to our Supply Chain team and an email is sent attaching all documents into the ONE email. 

     

    This is what it looks like:

    rara_0-1650051139536.png

     

    Step 1: Find the Form name from your files using the drop-down

    rara_1-1650051272198.png

     

    Step 2: Enter the Form name again and bring over Response Id from dynamic options

    rara_2-1650051350221.png

     

    Step 3: (Optional) Get responder's information to add their name inside the body of the email that you send.  To keep the form short I do not ask responders to type their name.  This step gets their name for me.

    rara_3-1650051485548.png

    Step 4: This step presumes you've already opened your form spreadsheet and saved it.  Add row to a table allows all the responses ever submitted to be tracked in the same spreadsheet and you can add columns to that spreadsheet and work in it.  Get user profile info in the previous step now allows me to add the full name of the responder to the table in the name field.  Match your dynamic Form responses up to the appropriate fields.

    rara_4-1650051804053.png

     

    Step 5: Search for Parse JSON in content area move over the Form question that asks for the responders uploaded files. In the 'Schema' paste the text below the image.

    rara_5-1650051979190.png

    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "name": {
                    "type""string"
                },
                "link": {
                    "type""string"
                },
                "id": {
                    "type""string"
                },
                "type": {},
                "size": {
                    "type""integer"
                },
                "referenceId": {
                    "type""string"
                },
                "driveId": {
                    "type""string"
                },
                "status": {
                    "type""integer"
                },
                "uploadSessionUrl": {}
            },
            "required": [
                "name",
                "link",
                "id",
                "type",
                "size",
                "referenceId",
                "driveId",
                "status",
                "uploadSessionUrl"
            ]
        }
    }
     
    Step 6: Not sure why we're doing this step, but it works.
     
    rara_6-1650052121431.png

     

    Step 7: This step is 3 actions - 'Apply to Each' and within that step 'Get file content using path' and 'Append to array variable. Do everything as shown. The only tricky part is getting the file path. To do that go to your App folder where your Form answers are and copy and paste the entire path of one of your test uploads and paste it in word or notepad. So if the path is /Apps/Microsoft Forms/My Intake Form Name/The Upload Question/Respondents attached file, just keep everything until "Respondents attached file" and paste that here into File Path and add the "name" variable as shown."

     

    rara_7-1650052780545.png

     

    For "Append array variable paste this and bring over the name and body fields as shown above

    {

      "Name": <DisplayName>,

      "ContentBytes": <AttachmentContent>

    }

     

     
    Step 8: To send all attachments in one email, I noticed that the send email has to be its own separate action. Previously I had added it as an action at the end of the previous step and it didn't work and was sending 1 email for each or a fwith the same number of attachments as the email number. Send your email following the below. Make sure the Attachments field looks exactly as below.
    rara_9-1650053070347.pngrara_10-1650053151639.png

     

    I hope this helps someone! 

     

     

  • rara Profile Picture
    rara 12 on at
    Re: Sharing Uploaded Documents via Forms

    Hi @RezaDorrani,

    Thank you so much for providing the link to this tutorial.  This post was so helpful to learn more about PowerAutomate, but I'm afraid I run into so much difficulty with simple things like figuring out my sharepoint site.  Just looking for a simple way to make the links accessible without making a list.  I am already creating a new Excel spreadsheet that I can edit and save as the responses come in.  I will keep trying with your method, but every time I put what I think is my sharepoint site it says I don't have access.  But thank you for the in-depth tutorial.  I will try again.

  • RezaDorrani Profile Picture
    RezaDorrani 12,141 on at
    Re: Sharing Uploaded Documents via Forms

    Hi @rara 

     

    Check How to save Microsoft Forms Responses & Attachments to SharePoint Lists or Libraries & Send Email - YouTube

     

    --------------------------------------------------------------------------------
    If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

    Thanks,
    Reza Dorrani, MVP
    YouTube
    Twitter

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard