cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BigE
Level: Powered On

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
Level: Powered On

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
Level: Powered On

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
Level: Powered On

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
Level: Powered On

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
Level: Powered On

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
Level: Powered On

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

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020.

thirdimage

Flow Community User Group Member Badge

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 241 members 5,728 guests
Please welcome our newest community members: