The ask, build on the better error reporting and share the actual error message when a cloud flow action fails. Earlier, the cloud flows were generating way too many error messages, one for each failed action, which was resolved using an array variable to store custom messages specified by the maker, then generating a single email at the end of the flow with the array items included.
Now, the business and the support team are asking for even better error reporting to be included in the error emails. Delivering on this request, the makers are now adding object flow variables to store the output of each failed action, then appending the error message of the object to the error array variable, with both actions nested within a Scope block.

Instead of the Append to array variable action being the Run after step for a failure, a Scope control block is added, allowing the makers to easily group multiple actions that need to be performed whenever an action times out, is skipped, or fails:

But first, initialize the object variable outside of the Scope control. With the variable initialized, within the Scope block, set the Body of the failed action as the object variable’s value:


Finally, using the error object variable, its properties can be set as the value of the Append to array variable action, to be emailed at the end of the flow, providing the additional error details requested by the business and the support team:

Conclusion:
Appending error messages to arrays is great for minimizing generated emails, but without the error message of the failed action, the support team doesn’t know exactly why the action failed and how to respond. With this additional context, everyone is happy.
“We must always be a strong presence, an unrelenting force working for equality and justice until the freedom gates are fully open.”
Dorothy Height
#BlackLivesMatter
Pingback: Power Automate: Cloud Flow + Better Readability (Scope Controls) | console.log('Charles');