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

Flow triggered by new record sending emails also after deleting that record

Hello all! 


I have a flow that is triggered when document or element has changed. It checks all the records in SharePoint and for those that have specific column changed it starts an approval action. Until the approval is not approved or rejected, flow is sending email notifications saying that you have approval pending with link to that approval. 


The problem comes when flow was launched and approval already went off/was activated, but it wasn't approved nor rejected and meanwhile that record for which flow is launching approval is deleted from Sharepoint. Email notifications are not stopping so flow just runs infinitely even though this record doesn't exists anymore and link of its approval is not active anymore. 


I wanted to add one more condition before sending email - something like "Check if this record is still in sharepoint / still exists" but I dont know how or if that's even possible. 


If anyone have a solution or any other advice about it, I would love to hear it. 

Resolver IV
Resolver IV

Hi @leksi31 -


I am assuming that your trigger provides a unique record id or path from SharePoint? If so, you could utilize parallel branching and a 'configure run after' setting to accomplish this.


Prior to any other actions in your flow, attempt to retrieve the document/item using an action like 'Get files' (depending on what you are doing this may be a different action). 


Add a parallel branch the same way you would add an action: 


I am using the 'terminate' action with the parameter of status set to 'cancelled'. This step will be used to make sure your flows don't register as failing when you are simply terminating them. 


Next, select the 3 dots on the corner of your terminate action and select 'Configure Run After' 



You can set the terminate action to only run when the 'Get' action you are using to find the record fails



This won't prevent the Flow from triggering, but will allow you to check for deletes and cancel the Flow before it attempts to process your deleted record further. 


Did my reply help? Please give it a thumbs up.
Did my reply answer your question? Please mark it as a solution!
If you liked my response, please consider giving it a thumbs up.


Frequent Visitor

Thanks for response. Problem is that flow is not failing or whatever, because I have a loop that's sending emails until approval is or approved or rejected. 


Example: I have records with id 5, 6 and 7. They all started a flow and approval request. Until I don't approve/reject it, I am getting reminder emails every day for each. I approve approvals for id 6 and 7, so flow is finished and that works fine. I dont do nothing with one from id 5 though, so emails are still reminding me every day. Let's say I now delete record with id 5. Email reminders are still coming, flow is still working but record is deleted. How can I condition it to stop, if there is no more record (it's not existing anymore) with specific id. I cant use terminate brcause flow is stil working fine and all actions are successful. 

Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,134)