Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 35

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. 

  • leksi31 Profile Picture
    35 on at
    Re: Flow triggered by new record sending emails also after deleting that record

    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. 

  • TaylorBecktold Profile Picture
    295 on at
    Re: Flow triggered by new record sending emails also after deleting that record

    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: 

    Taylor_Becktold_2-1640114170743.png

    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' 

    Taylor_Becktold_3-1640114344566.png

     

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

    Taylor_Becktold_4-1640114379037.png

     

    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.

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,653 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow