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

Flow with attachment sending email multiple times

I have a number of Flows set up which have the ability to send an email to a recipient with multiple attachments that are pulled from a SharePoint list.

This is mostly working great, except for that fact that most of the time, when a user creates a SharePoint item with one or more attachments, the Flow sends two emails, one with no attachments, and one with all attachments.

This issue isn't compeltely reproducible. Sometimes it does not duplicate the emails and sends, for example, one email with 2 attachments on it. I have 8 flows set up the exact same way and it can happen to any of them. 

The flow is:

1. When an item is created or modified in SP list

2. Get Attachments

3. Initialise variable (attachmentArray)

4. Apply to each > Get Attachment Content > Append to array variable:

{
"name": @{items('Apply_to_each')?['DisplayName']},
"contentbytes": @{body('get_attachment_content')['$content']}
}

5. Send an email, Attachments = attachmentArray

 

 I set up my flows with help from the Microsoft Blog (including the comments section for the fix):

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

1 REPLY 1
Community Support
Community Support

Hi @ poweradmin,

 

Could you please share full screenshot of the configuration of your flow and more details?

 

I have made a test on my side as you said and the flow works well as expected. Only one email containing all the attachments in the item was sent out and there was no such issue as you mentioned.

 

Image reference:

31.PNG

Append to array variable Action:

 

Value(same as you provided)

 

{

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

"contentbytes": @{body('get_attachment_content')['$content']}

}

 

36.PNG

 

When I added an item with two attachments in the SP list, the flow worked well and only one message with the two attachments added previously was sent, as below:

 

32.PNG

 

 

The flow works successfully as below:

37.PNG

 

Received only one email containing the two attachments previously added to the item, as below:

34.PNG

 

You could check the output of the "Get attachments" action to see whether it gets the attachments contained in the item.

 

Please take a try and let me know if issue still exists.

 

Best Regards,

Barry

 

 

 

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.

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (31,098)