Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Trigger email to send when list item is modified with or without an attachment

I am pretty new to SharePoint and I have created a ticketing system that will generate out an email when a list item has been modified. I am running into a problem regarding attachments in the email.


Originally I created a flow that worked however it did not include any attachments listed on the list item. I created a replacement flow that would pull in the attachments but would only trigger the email if an attachment was included. I made some adjustments to it and now it sends two emails for each list item - one with an attachment and one without it. If there is no attachment then it sends the same email with no attachment listed twice.


What I am wanting is one flow that will send only one email. If there is an attachment to include it, if no attachment is listed, send an email with no attachment. Can someone let me know what I need to correct? Or how to create a new flow if that is what is needed. 


1st steps.PNG2nd steps.PNG

Post Patron
Post Patron





I have created a flow that sends an email based on the item attachment condition, the flow sends multiple attachments together in one email.




json to append in the array avriable is 


"Name": @{items('Apply_to_each_2')['DisplayName']},           
"ContentBytes": @{body('Get_attachment_content_for_item')['$content']}


display name is selected from get attachments 2 action and for contentbytes property @{body('Get_attachment_content_for_item')['$content']} should be written in the expression window. The expression may change based on your action names.







Accept my post as answer if it resolved your question.


Frequent Visitor

Could I see the drop down you have in the "Initialized Variable Attachment Array? I was originally getting an error there. I corrected it and the flow will run but I am still getting two emails. 



Its just an array variable, if you are still getting two emails you might want to check if the email action is under a loop.



Frequent Visitor

Yes it appears to have the loop.

The only difference I see between your flow and mine is I have a Switch in place for the status value inbetween the Variable Array and Condition for the attachment = true.  The status is the factor that determines if an email needs to be generated. 

If you can start the reply case with if condition and move the get attachments action to under the yes branch and above the apply to each loop action and delete the apply to each loop 2 action which is causing multiple emails will resolve the issue. I am not sure if there is reason for you to have get attachments above apply to each 2 loop.

Frequent Visitor

Would you be able to show me an example of the IF condition? I believe I tried a condition and it did not work which is why I changed to a Switch condition. Maybe I have had the formula incorrect???



Its a simple condition which checks the has attachments column from item created or modified action




Let me know if you have any questions.

Frequent Visitor

Oh yes, I originally did that and it did not work. That's when I found the switch case and that seemed to fix one issue. 

I started working on another test flow today and I have it so that it only sends one email however it does not pull the attachment in. It looks like it is set up the same as yours above just with the switch case in place. 

Helpful resources

MPA 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


Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (52,687)