cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Helper I
Helper I

Re: send email with multiple attachments from powerapp

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
Highlighted
Community Support
Community Support

Re: send email with multiple attachments from pwerapp

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.
Highlighted
Helper I
Helper I

Re: send email with multiple attachments from powerapp

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

Highlighted
Regular Visitor

Re: send email with multiple attachments from powerapp

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (7,325)