Power Automate Fundamentals # 70: Understand Cancel Flow Run Action in Power Automate

Introduction:

Generally in certain scenarios, we have to cancel current flow if at all some condition was not met. So with out opening each flow in the consolidated list of flow runs we can easily find which flow runs passed and which are cancelled .In Power automate we can achieve this by using Cancel Flow Run Action.

Step 1:                                                                                                                            

Login to the required Power Apps environment using URL make.powerapps.com by providing username and password and click on Flows on the left-hand side as shown in the below figure.

Step 2:

After Step 1, Click on New Flow and select instant cloud flow and provide the trigger as Manually trigger a flow and click on Create as shown in the below figure.

Step 3:

After Step 2 , name the flow as Understand Cancel Flow Run Action and Manually trigger  provide input values of by selecting type of user input as text as

Title : Signal

 Value : On 

  as shown in the below figure.

Step 4:

After Step 3 , Take Initialize variable action and provide the values as below

Name : Signal Status

Type : String

Value : @{triggerBody()[‘text’]} [ From Step 3]

  as shown in the below figure.

Step 5:

After Step 4, take condition Action and provide the values

Left side as variables(‘Signal Status’)

Comparison operator: is equal to

Value : on

As shown in the below figure.

Step 6:

After Step 5, under yes part take a compose action and provide the inputs

As

Inputs : Good Wifi Network connectivity

  as shown in the below figure.

Step 7:

After Step 6, under no part of the flow take a cancel Flow Run action and establish the connection as shown in the below figure.

Step 8:

After Step 7, we must provide the values as below

Environment : workflow().tags.environmentName

Flow :workflow().name

Run ID : workflow().run.name

As shown in the below figure.

Step 9:

After Step 8, now save and test the flow and provide the value as on you should see the see the yes part of the condition  action will get executed as shown in the below figure.

Step 10:

After Step 9, now save and test the flow and provide the value as off you should see the see the no part of the condition  action will get executed and cancels the flow run as shown in the below figure.

Step 11:

After Step 10, now see the flow runs and observe Status as Test succeeded / Test canceled  as shown in the below figure.

Note:

  1. Based upon the use case this cancel flow run action can be used.
  2. Not only we can cancel current flow but also, we can stop any child flows in case if some condition was not met.

Conclusion: In this way we can easily use Cancel Flow Run Action in power automate.

One thought on “Power Automate Fundamentals # 70: Understand Cancel Flow Run Action in Power Automate

  1. Pingback: Rewind April 2022 – Common Man Tips for Power Platform, Dynamics CRM,Azure

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s