Power Automate Tip #1 : Use Scope
There are occasions where your flow breaks at a specific step and you may notice the flow run fails entirely which means you may end up troubleshooting the flow run periodically. Scope is an action that covers the specific step or a sequence of steps and you could capture the failure of these steps so you could perform the appropriate actions based on the success or failure. For instance, here is an use case where I would like to compress a PDF file once uploaded on to a SharePoint library using Adobe Compress and set the Compressed field to Yes so it doesn't try to compress again. Lets say if someone uploads a file that's already compressed, it will throw an error at the Compress PDF and there wont be any log of it.
The better way to handle is to do the following :
1. Use a Scope and make a parallel activity (One configured run after - has failed of Scope and another is successful with the success activity)
2. On the success, do what you need to do on success
3. On Failure, compose the result of the scope using the expression - result('Scope')
4. Extract the message and log into your ExceptionLog
5. Get back to the sequence of steps that has to happen post compression or failure.
Comments