cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BigE Helper I
Helper I

Cancel Running Flow on Field Value Update

The Flow that is triggered is based on a status value field. On status of Complete, I have it send an email to the user then delay for 7 days before archiving the list item and deleting. A requirement is needed to be able to change the status to Reopened. If I do this, a new Flow run happens as expected. What I would like to be able to do is cancel the previous Flow based upon the status value of Reopen.

10 REPLIES 10
Super User
Super User

Re: Cancel Running Flow on Field Value Update

@BigE 

Insert a Get Item action after the delay in your Flow and retrieve current data from the list item.  If the value of the Status is Reopen, use a control terminate action (with success) and end the Flow.  Otherwise, proceed and archive/delete the item.

 

Let me know if you need an example.

 

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
BigE Helper I
Helper I

Re: Cancel Running Flow on Field Value Update

@ScottShearer I get what you are saying here, I just don't believe it is going to work for my situation. I've setup a switch step for the status value to run on Complete. The delay step is there to write a value to another list after 7 days and then delete this item. If someone changes the status from Complete to Reopen, the Flow will not know about that and will run a new instance leaving this one running the delay. The thing with this one is that the status will go from Reopened back to closed which will trigger this process again.

Super User
Super User

Re: Cancel Running Flow on Field Value Update

@BigE
What I propose is that you re-check the status value immediately after and below the delay with a new Get Item action and before the delete action. You will know if the status is reopen and can terminate the Flow. This will work in the situation as you have described it. Please give it a try.


If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
BigE Helper I
Helper I

Re: Cancel Running Flow on Field Value Update

@ScottShearer 

Will this work in a switch case? It's looking at Completed, not Reopened. I might be just overthinking this. If you still have an example, please send it to me. This it what my steps look like.

Flow.PNG

Super User
Super User

Re: Cancel Running Flow on Field Value Update

@BigE 

Please take a look at the screen shots below and let me know if you have additional questions.

Work Orders 1.jpgWork Orders 2.jpg

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
BigE Helper I
Helper I

Re: Cancel Running Flow on Field Value Update

@ScottShearer 

I added this step but it still will not work. What happens is that when the status goes from Reopend back to Closed, a new Flow process kicks off and the old Flow is still running. I need to have it check an ID somewhere and terminate the orininal Flow.

Super User
Super User

Re: Cancel Running Flow on Field Value Update

@BigE 

Please post a screen shot of your Flow in Design view as currently configured.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott
BigE Helper I
Helper I

Re: Cancel Running Flow on Field Value Update

@ScottShearer 

This is how I originally configured the flow. There is one other switch case for In Progress that is not in the view.

Flow.PNG

BigE Helper I
Helper I

Re: Cancel Running Flow on Field Value Update

@ScottShearer 

What if I added a 'Do Until' step to buffer the status change?
Flow.PNG

BigE Helper I
Helper I

Re: Cancel Running Flow on Field Value Update

@ScottShearer 

Thanks for all of the assistance with this. I decided to punt and just remove all of the steps from the schedule to deletion of the list item. I created a new Flow that will run a daily check to see if there are any 'Completed' list items older than 7 days and it will copy those to a secondary list and delete the source items. Thanks again for your responses.

 

-Eric

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (9,811)