While foreseeable errors (such as references to Blank) should be prevented by prior checking, unforeseeable errors inevitably occur.
Power Automate uses “scopes” to control the behavior when such errors occur.
2021/3/26 note: Since the try-catch-finally template is now available, it is also useful to use this template.
Microsoft Power Automate
What is Scope?
Scope is a feature that allows Power Automate processes to be managed together.
It is very useful to use it for the purpose of organizing processes, as it makes it easier to see the flow.
And this “scope” can also be used for exception handling.
How to write exception handling using scopes
Handling exceptions using scopes is accomplished by enclosing the process that is likely to generate an error in a scope and adding a parallel branch behind that scope in the event of an error.
For example, if there is a possibility of an error in the process against SharePoint, enclose the process in a scope as shown in the image,
and select [Add Parallel Branch] behind the scope.
Add “an action to be executed when some problem occurs in the scope (such as sending an email to the flow manager)” to the added parallel branch,
remove [succeeded] from the execution condition so that this process will be called when a process in the scope fails.
*This time, it is also called when skipped (an error occurs further up the flow) or when a timeout occurs.
*This time, it is also called when skipped (an error occurs further up the flow) or when a timeout occurs.
It is important to define what to do in case of failure for unexpected events, such as editing the SPO list without knowing that Power Automate exists.
コメント