In this article, let’s see how you can catch error during flow executions and send information via email. My way to catch error is by incorporating error handling , and track in log table or SharePoint list on you can also send and email with error details. First of all, if you didn’t , you should read my old article “Power Automate – Try Catch”.
Basically, we have a Power Automate flow with manually trigger who catch wheater informations and log them in SharePoint list.
According, to my old article. Add “Try Catch” scopes. Our flow became:
In this case, my “Catch” scope, is configured to execute only in case of:
- has failed
- Is skipped
- has time out
Basically, now you can add some action to track if your flow going in error and send alert to users. By, let’s do a little additional step, and get error details.
Get errors details
How can we get error details?
In our “Catch” scope, we shuld add “Compose” block to get output result of our “Try” scope, then, we should filter result to extract error details.
Get “Try” scope result, with compose: (you must use “Get result” action)
Now, use “Filter array” action, to filter “Get-Try-Result” result action. In filter, I added this:
and filter for “Is Equal” to “Failed”, so final result is:
Now you can send email with details or track them on list (or both 🙂 ). You can get Action Name, with this expression. To try , I added bool variabile, and set to null in “try” scope.
And error details:
So , final result of “Catch” scope is:
Finally, in case of error, here is the detail:
I hope these information can help you! Leave me a comment to let me know what you think, or if you have a better idea to handle this case.
Contact me for questions! Have a nice day!