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

Adding multiple files from MS Form (Group) to an email

Apologies for the Newbie post.  I've searched the forum extensively and still drawing a blank having tried several different solutions.

 

We have a MS Form (associated with a Group) that collects reports of quality incidents.  The form allows up to 10 files to be attached (normally photos).    Once the form is submitted we want to email key details to a number of people for immediate action - and need to include the attachments to the email.

I've followed the instructions in this blog post https://www.bythedevs.com/post/working-with-files-on-ms-forms-group-form-in-ms-power-automate 

 

In order to try out the different email options I've created three arrays:

  • Uploaded_Files (which has the "names" and the "file content"
  • File_Names (which just has the filenames)
  • File_Content (which should just have the file content)

 

There are two issues that I need help with:

1. I'd like to use the "Send an email notification (V3)" but cannot work out how to a add multiple attachments

2. If I used the "Send an email notification (V2)" I get an attachment to the email but when I try to open it (a simple jpg) the computer complains that the file format is not recognised

 

Here's my flow:

Dr_Chris_1-1596098492980.png

Dr_Chris_2-1596098502051.png

Dr_Chris_3-1596098580327.png 

where the Value field is 

{

"Name": "@{items('Apply_to_each')['name']}",

"ContentBytes": @{body('Get_file_content_using_path')['$content']}

}

Dr_Chris_4-1596098598343.png

Dr_Chris_6-1596098701037.png

where Attachments is  Fx variables('Uploaded_Files')

 

Dr_Chris_7-1596098820991.png

where Attachment is Fx  variables('File_Content')

 
and AttachmentFileName is Fx variables('File_Names')

 

 

 

Thanks for your help.

 

I'm also using the same flow to save the results from the form in a Sharepoint List, so once I've got the email sorted my next challenge will be getting the files attached to the list too...

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi

I did some work on this over the weekend and managed to get it working:

Here is the basic structure of the relevant section of the flow:

Dr_Chris_0-1596529565065.png

 

As the form is associated with a Group, I am using the "Get file content using path" Sharepoint function, using the "link" variable from the Parse JSON function.  The secret here was to use the full URL in the "File Path", not just the file name which is what the blog used.

Dr_Chris_3-1596529923107.png

 

 

In the "Append to array variable" function I had to enter this by hand - the code from the Blog does not work, so I typed in the code to create the basic shape of the array variable and then selected the Dynamic Content for the JSON output "name" and the output from the "Get file content using path" function.

 

Dr_Chris_2-1596529883160.png

 

Once I'd made these changes it works fine.


Thanks for looking at this for me.

 

 

View solution in original post

4 REPLIES 4
v-bacao-msft
Community Support
Community Support

 

Hi @Dr_Chris ,

 

Send an email notification (V3) can only add one attachment, which is a known limitation. You can refer to the following thread to configure Flow.

Solved: Multiple picture in email from Forms - Power Platform Community

 

If the form is a group form, then you need to use Get file content in the SharePoint connector to get the attachment content, showing that you are already doing this.

 

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.

Thanks

I've tried following this blog - even started again with a fresh form and flow that just has the file upload, nothing else.

The flow completes successfully and sends an email with the correct number of attachments, but when I try to open the attachment (a small png file) the picture viewer complains that the file format is not supported, so somewhere in the flow the body of the file is being corrupted.

Any ideas?

 

 

Hi @Dr_Chris ,

 

Could you share the screenshot of the flow configuration and flow run history so that we could check the issue?

 

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.

Hi

I did some work on this over the weekend and managed to get it working:

Here is the basic structure of the relevant section of the flow:

Dr_Chris_0-1596529565065.png

 

As the form is associated with a Group, I am using the "Get file content using path" Sharepoint function, using the "link" variable from the Parse JSON function.  The secret here was to use the full URL in the "File Path", not just the file name which is what the blog used.

Dr_Chris_3-1596529923107.png

 

 

In the "Append to array variable" function I had to enter this by hand - the code from the Blog does not work, so I typed in the code to create the basic shape of the array variable and then selected the Dynamic Content for the JSON output "name" and the output from the "Get file content using path" function.

 

Dr_Chris_2-1596529883160.png

 

Once I'd made these changes it works fine.


Thanks for looking at this for me.

 

 

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

Top Solution Authors
Users online (1,940)