Exception handling in Power Automate Flows
Out of other errors type one is logical errors. There are many reasons for this type of errors, for example, unexpected user input etc.
In most of computer languages we handle these error by exception handling or try-catch blocks. However, in Power Automate we also have this feature available to handle exceptions well in the flow and keep the flow running to complete rest of the flow logic.
There are two ways to implement exception handling in Power Automate Flows.
- Use Power Automate template (https://emea.flow.microsoft.com/en-us/galleries/public/templates/e8e028c6df7b4eb786abdf510e4f1da3/try-catch-and-finally-template/)
- Using 'Scope' action with 'Configure Run After' property
Let's dig into each block in the template
Try - Contain all the actions coming from main flow
Catch - This control configured to run once "Try" block is failed
Finally - This block must run, no matter what is the output of previous block
Now lets configure Try-Catch blocks within a flow.
- Create an instant flow
- Add a 'scope' actions
- Rename the 'Scope' action to 'Try' and add another 'Scope' actions for 'Catch' (and if needed for 'Finally' as well.)
- Now configure execution of 'Catch'. Click on three dots (...) and click 'Configure run after'. (Perform same steps to configure execution for 'Finally' block)
Comments
Post a Comment