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.
Terminate control gives you option to set the status (Failed , Succeeded , Cancelled , Custom Value ) .
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.
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.
This only works if you use one of the three preset status codes.’Failed, Cancelled, Succeeded'.
Hope it helps!