cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnonyMouse
Helper I
Helper I

send email with multiple attachments from pwerapp

I would like to send all the attachments that the user added to a sharepoint list in an email from the NewForm of a Powerapp upon submitting. I understand there is an email functionality ,Office365.SendEmail , but I am not able to figure out how to send multiple attachments.

I tried to do this in Flow but all of a sudden it became inconsistent.

using the link, https://preview.flow.microsoft.com/en-us/blog/multiple-attachments-single-email/, I was able to get the flow with attachments working. Today all of a sudden it has started behaving inconsistently.

If I attach 5 files, sometime 3 files come, sometimes 1 file come, I can see all of them in the powerapp form but none get attached to the sharepoint list

If I attach two files, 6mb, 8mb, no files come, but all get attached to the sharepoint list

 

Due to this inconsistent behviour, I would like to try send the email from powerapp itself.

Kindly help.

1 ACCEPTED SOLUTION

Accepted Solutions

I seemed to have resolved this issue with Flow itself.

I believe the flow was getting triggered even before all the attachments were added by Powerapp to the Sharepoint list.

As I understand, 10mb is the current size limit for attachment. Each attachment of size 10mb, takes around 6 seconds to get attached to the Sharepoint list from the powerapp. I believe a max of 50 mb attachment can be sent by outlook as beyond that ,the flow gave an error about the size limit. So 5 files of 10mb each would take 30 seconds. 

So in the flows , I added a delay of 40 seconds before it processes the attachments. Now it seems to be working.

But the only issue that, irrespective of whether or not there is any attachment, emails would be delayed by about 2 or 3 minutes.

Although we could check if there was attachment added, it would not work always as the flow gets triggered immediately upon item creation even before any attachment was added I believe

View solution in original post

3 REPLIES 3
v-micsh-msft
Community Support
Community Support

Hi @AnonyMouse,

 

Yes it could be done by using the Office365.SendEmail() action.

But there is a little problem with the Attachment control, as the Name field is always empty, and currently there is no workaround to deal with that.

 

If the Email need to be sent after the Form submit, then the formula should be, here we use the Attachments from the SharePoint List, as this attribute would contain the File name and the content:

Office365.SendEmail("EmailAddress","Subject","EmailBody",{Attachments:ForAll(LookUp(List1,ID=SharePointForm1.LastSubmit.ID).'{Attachments}',{Name:DisplayName,ContentBytes:Value})})

If you would like to save the file before submitting to SharePoint list, then the situation here is we need to save all the images or files with the same file name and file type, this is good if all the files are in the same file type.

The formula for it is as below:

Office365.SendEmail("EmailAddress","Subject","EmailBody",{Attachments:ForAll(RenameColumns(DataCardValue3.Attachments,"Value","FileContent"),{Name:"Image.png",ContentBytes:FileContent})})

Regards,

Michael

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

I seemed to have resolved this issue with Flow itself.

I believe the flow was getting triggered even before all the attachments were added by Powerapp to the Sharepoint list.

As I understand, 10mb is the current size limit for attachment. Each attachment of size 10mb, takes around 6 seconds to get attached to the Sharepoint list from the powerapp. I believe a max of 50 mb attachment can be sent by outlook as beyond that ,the flow gave an error about the size limit. So 5 files of 10mb each would take 30 seconds. 

So in the flows , I added a delay of 40 seconds before it processes the attachments. Now it seems to be working.

But the only issue that, irrespective of whether or not there is any attachment, emails would be delayed by about 2 or 3 minutes.

Although we could check if there was attachment added, it would not work always as the flow gets triggered immediately upon item creation even before any attachment was added I believe

View solution in original post

Many thanks Smiley Very Happy !! I just spent my day trying to understand why it doesn't work and then i found your post !! 

Helpful resources

Announcements
PA 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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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
Top Kudoed Authors
Users online (2,136)