cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HR2
Level: Powered On

Send email with attachment from SharePoint list when condition is met

Hi, 

 

Previously had help setting up the below flow so it didn't send multiple emails and it's working perfectly now, but I would like to be able to send attachments from the SharePoint list in the email too (there may be multiple attachments and I'm using powerapps to input the attachment and other columns on the SharePoint list) I don't want it to end up sending multiple emails again

 

Flow 1.PNG

 

Flow 2.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
HR2
Level: Powered On

Re: Send email with attachment from SharePoint list when condition is met

I have managed to get it working, the solution seemed to be the below, this code after contentbytes 🙂 

Flow 1.PNG

 

View solution in original post

8 REPLIES 8
Dual Super User
Dual Super User

Re: Send email with attachment from SharePoint list when condition is met

The key to doing this is to build an array of attachments in a variable using a Loop before you send the email.  Then you can click the icon to the right to the Attachment name and switch the input over to accept an array of attachments.  See the icon highlighted in the screenshot.

screenshot.png

Here's an article that explains how to create the array of attachments in a variable.

https://flow.microsoft.com/en-us/blog/multiple-attachments-single-email/



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

Re: Send email with attachment from SharePoint list when condition is met

Hi, 

 

I tried this and it would only let me create the array at top level, and just couldn't get it to work

Dual Super User
Dual Super User

Re: Send email with attachment from SharePoint list when condition is met

YOu initialize the array variable at the top level with a null value, but then you can 'Append to the Array' inside the loop.  Read the article I posted.  There a full step by step explanation with screenshots.



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

Re: Send email with attachment from SharePoint list when condition is met

I have followed this exactly from what I can see but it fails at the condition part

 

Flow 1.PNG

 

Dual Super User
Dual Super User

Re: Send email with attachment from SharePoint list when condition is met

Your problem is something in the Send Email Action.  Can you send a screenshot of that and the loop where you are building the attachments array.



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

Re: Send email with attachment from SharePoint list when condition is met

Thanks for your patience with me, see below my full flow

 

 

Flow 1.PNG

Flow 2.PNG

 

Flow 3.PNG

 

 

 

Dual Super User
Dual Super User

Re: Send email with attachment from SharePoint list when condition is met

That all looks correct.  In the failed run you posted earlier, what is the error in the Send Email Step?



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

Re: Send email with attachment from SharePoint list when condition is met

I have managed to get it working, the solution seemed to be the below, this code after contentbytes 🙂 

Flow 1.PNG

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,604)