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

Solved: Send Email with Multiple Attachments from MS forms

Hi All, I'm trying to send an email with multiple attachments coming from MS forms. But the base 64 expression using file content after saving the flow when I try to check edit again it changes back to file content only instead of being wrapped around a base 64 expression. I hope you guys can help me.
 
Pictures 1, 2 and 3 is my desired flow and the picture number 4 is what happens to the base 64 expression after saving.
 
The flow still works but when I open the attachments they are all corrupted.
 
This is was my reference YouTube video: Power Automate Tutorial - Microsoft Forms Multiple Attachments (Jon Levesque Tech Channel)
 
pa1.jpgpa2.jpgpa3.jpgpa4.jpg
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User III
Dual Super User III

Here's a Blog post with a full walkthrough of a working example.

https://www.dontpapanic.com/blog/?p=656 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

7 REPLIES 7
Highlighted
Solution Sage
Solution Sage

Hello Team,

 

There has been a change in the way Content is being rendered now inside the Power Automate. You no longer need to parse the "Content" and filter out the $content property inside it to get meaningful content, just adding the "File Content" directly in your Append to array variable will give you the meaningful file content.

 

I solved another question over here-
https://powerusers.microsoft.com/t5/Building-Flows/Get-attachments-broken/m-p/715647#M97713

 

 

yashkamdar_0-1602702873264.png

 

Here I am trying to parse the Attachment content, instead of this you will need to pass the file content directly in the Append to array variable.

 

I hope you understand what I am trying to convey.

 

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!

Highlighted

Hi @yashkamdar ,

 

I tried to replicate this and I get the error below on "send an email"

 

The 'inputs.parameters' of workflow operation 'Send_an_email_from_a_shared_mailbox_(V2)' of type 'OpenApiConnection' is not valid. Error details: The API operation 'SharedMailboxSendEmailV2' is missing required property 'emailMessage/Attachments/0/Name'.

 

I checked the link you provided for a similar issue but the trigger is SharePoint. Maybe it is different when the source of the file is from MS forms instead of SharePoint?

Highlighted

Hello Team,

 

I will share a useful insight and this will definitely help you out.

 

The trick here is instead of using the "Get file content using Path", you need to use "Get file content" action, only then the attachment will get properly rendered. The Get file content using path used to work before but something changed a couple weeks ago and it no longer renders the attachment correctly hence the trick to use the ID instead of Path.

 

You might want to look at the video tutorial I have on my youtube channel in case of further queries-

https://www.youtube.com/watch?v=xlzAwgtkb74

 

I solved a similar problem here -

https://powerusers.microsoft.com/t5/Building-Flows/Unable-to-open-file-attachment-in-email-sent-by-f...

 

Capture.PNG

 

Once you get the file content using above method, pass the file content in Append to array variable, also make sure you are passing the name as well because while creating the attachment inside the email you will need both the name as well as file content.

 

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!

 

 

 

 

 

 

Highlighted

Hi @yashkamdar ,

 

Thanks for looking into this.

I tried "Get file content" this time but when the it comes to the "Send email" action I get this error again:

 

The 'inputs.parameters' of workflow operation 'Send_an_email_from_a_shared_mailbox_(V2)' of type 'OpenApiConnection' is not valid. Error details: The API operation 'SharedMailboxSendEmailV2' is missing required property 'emailMessage/Attachments/0/Name'.

 

Kind regards,

 

James

 

pa7_v2.jpg

Highlighted
Dual Super User III
Dual Super User III

I plan to do a Blog on this in the next couple of days, but here is a quick rundown of how to attach multiple files uploaded to a question in Microsoft Forms to an email. You are doing almost everything correctly, but I would suggest two changes to your process.

 

1) The attachments in Forms are automatically uploaded to your OneDrive.  You are trying to retrieve them using the path, but its easier to retrieve them using the id, which is also in the JSON you parsed.  

2) The other problem with what you are doing is trying to convert the content to Base64.  The Content doesn't need to be converted.  In this case it can be used as is.  You also don't want quotes around the content you are inserting in the Array.

 

Take a look at the screenshot below.

image.png

 

Once the array is built you can just insert it into the email Files Array field.

image.png

I've tested this and it does work as expected.  The only caveat is that you need to stay within the file size limits for Forms and your mail system.

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Dual Super User III
Dual Super User III

Here's a Blog post with a full walkthrough of a working example.

https://www.dontpapanic.com/blog/?p=656 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Highlighted

It works now! Your a genius! Thank you very much for the support! 🙂

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.

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