Skip to main content

Notifications

Terminate Control : Power Automate/Flow

Have you ever thought of terminating power automate/flow if condition is not met?

Recently I have come across this scenario and I used ‘Terminate’ control to achieve this.

image.png

 

Terminate control gives you option to set the status (Failed , Succeeded , Cancelled , Custom Value ) .

image.png

 

 

If you select Failed , it gives you option to provide error code and error message.

In this way , we can terminate the flow using ‘Terminate’ control if condition is not met.

In my case, I want to terminate the flow based on work order status value . Have a look at the below image for reference.

image.png

 

Note :

Terminate control will terminate the whole flow. We cannot use it to terminate any specific branch .

If you choose ‘Enter custom value’ for Status, It will throw error while saving the flow(see below image for reference). Hoping that

Microsoft will fix this soon.

image.png

 

This only works if you use one of the three preset status codes.’Failed, Cancelled, Succeeded'.

Hope it helps!

 

Comments

*This post is locked for comments

  • GI-04112040-0 Profile Picture GI-04112040-0
    Posted at
    Terminate Control : Power Automate/Flow

    A plain text custom value will always throw an error. It needs to match one of the options for the status of the flow run, which are only Succeeded, Canceled, or Failed. If you enter a custom value here like "Rejected by User" or something like that, it would not match a valid selection for the status of the flow, meaning that when looking at your flow runs you would have some that were just blank.

     

    What I do wish is that you could add a code and a message to "canceled" for auditing. So I can quickly pull up my flow and see if a flow failed that it actually failed and didn't just reach the terminate action of my flow. My example is an approval flow. If the approval request is rejected, I want the flow to kick off an email to the requestor and stop performing actions, so I added the Terminate control. Marking it as Succeeded is misleading because a Team is created at the end of the flow, so we'd like any flow that succeeds to represent the number of Teams that were created by the flow. If we terminate them as "Failed" then we can't easily identify what failed and what was rejected at the approval stage, but if I use canceled, I can't add a description for why. In this case I would say "Request Canceled by Approver" or something along those lines.

  • Bert_Rountree Profile Picture Bert_Rountree 1
    Posted at
    Terminate Control : Power Automate/Flow

    The purpose of the "Custom Value" option is to dynamically set one of the static selections with an expression to reflect root cause for termination.  For example, a single termination control at the end of a flow would show "Cancelled" if a condition were not met or "Succeeded" if so.  

    Example:

     

    Terminate.png

  • jomiya Profile Picture jomiya 1
    Posted at
    Terminate Control : Power Automate/Flow

    3-23-2023 ... still not fixed.

  • smiley-b Profile Picture smiley-b 3
    Posted at
    Terminate Control : Power Automate/Flow

    November 2, '22....still throws an error. 

  • Cryptonic Profile Picture Cryptonic 3
    Posted at
    Terminate Control : Power Automate/Flow

    How many years long is the "soon" window on this?

  • kkeller Profile Picture kkeller
    Posted at
    Terminate Control : Power Automate/Flow

    Any chance this gets fixed in our lifetimes?

  • CParsons09 Profile Picture CParsons09 141
    Posted at
    Terminate Control : Power Automate/Flow

    Still a problem 🙂

  • skjones91199 Profile Picture skjones91199
    Posted at
    Terminate Control : Power Automate/Flow

    Yes - April 2022 and I just encountered this.

  • DavidQuezada Profile Picture DavidQuezada
    Posted at
    Terminate Control : Power Automate/Flow

    It's January 2022, and the issue is still happening.

  • FlorianKroll Profile Picture FlorianKroll
    Posted at
    Terminate Control : Power Automate/Flow

    If it's not supported it should not show up as it is confusing. Is there any news about this issue?