cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Trying to attach an uploaded file submitted using a form

Hello! 

 

First time posting here.  A partner turned me onto this site to come and seek advice.  I am using Forms for our locations to submit incident reports which is working great!  Everything is "Flow"ing as it should 🙂  My process I use is below

  • Locations access SharePoint hosted Intranet which I have embedded as an app in Teams
  • Locations submit the form which triggers the flow I have created
  • The flow works like below
    • Data is pulled from all of the form responses and then put inline with custom HTML
    • This is then emailed using the "Send email from a shared mailbox v2" action
    • Email is sent to the correct recipients

I want to add an enhancement to the form where a location filling out the form can submit an attachment.  I then want that attachment sent out with the email that is generated from the flow.  I see the file that is uploaded hosted on SharePoint.  My question is what do I add to my flow to pull this upload and then attach it to the email that is sent?

 

A couple of pictures with embedded questions below to show what I have in my flow that works

 

IHOPPaul_1-1601507524557.png

 

IHOPPaul_2-1601507544630.png

 

Any advice welcome and appreciated!  Thank you

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @IHOPPaul  ,

 

Please make sure the content in the Append to Array variable as below:

 

 

{
 "Name": "@{items('Apply_to_each')['name']}",
 "ContentBytes": @{body('Get_file_content_using_path')['$content']}
}

 

 

 

And if your flow still don't work, please take a try to add a Compose action before the send an email action and insert the Attachment Array to it, run the flow to see what is the output of the Compose action.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

6 REPLIES 6
Community Support
Community Support

Hi @IHOPPaul ,

 

Hope the link below could be your reference:

https://www.bythedevs.com/post/working-with-files-on-ms-forms-group-form-in-ms-power-automate

 

Best regards,

Alice       

 

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

Resident Rockstar
Resident Rockstar

@IHOPPaul 

 

Welcome to the community 🙂  You can follow the link mentioned by @v-alzhan-msft  or just follow the video tutorial(if you do not like reading) at https://www.youtube.com/watch?v=kNC8q6NzBEc 

 

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!

This worked brilliantly BUT the files that are attached to the email are corrupted somehow.  They can be clearly seen and downloaded but cannot open at all.  Any ideas?

Hi @IHOPPaul ,

 

Could you please share the screenshot of the configuration and the run history of the flow?

 

Best regards,

Alice       

 

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

Here is the flow history

IHOPPaul_0-1601660445816.png

 

Here are the steps I have.  These were created according to the steps presented n the YouTube video in this thread

 

IHOPPaul_1-1601660509236.png

 

IHOPPaul_2-1601660534352.png

 

IHOPPaul_3-1601660557926.png

 

Here is the attachment section for that "Send an email.." action

 

IHOPPaul_4-1601660662722.png

 

Let me know if you need me to send more data or if anything stands out.  The attachments are there.  They look right with the right icons etc.  They just will not open and are called out as corrupted.  I should note these files are being captured from my personal OneDrive for business store.  Thanks for being willing to help!

 

 

 

 

 

 

Hi @IHOPPaul  ,

 

Please make sure the content in the Append to Array variable as below:

 

 

{
 "Name": "@{items('Apply_to_each')['name']}",
 "ContentBytes": @{body('Get_file_content_using_path')['$content']}
}

 

 

 

And if your flow still don't work, please take a try to add a Compose action before the send an email action and insert the Attachment Array to it, run the flow to see what is the output of the Compose action.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Users online (12,080)