Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Trying to get error details from a prior scope - outputs('TryScope-LoadLookupDataFromSharePointLists') returns null


I want to provide some basic error handling for unexpected conditions, but I don't want have to manually get the output for each action. So I group similar actions into a "TryScope", then run_after_error on a CatchScope.



Create scope "TryScope-LoadLookupDataFromSharePointLists"

Create scope "CatchScope-LoadLookupDataFromSharepointLIsts", set "should run after  = has failed"

  (See image 1)Try-Catch-Scopes-RunAfterSettings.jpg



Within the Catchscope I am using: fx:          outputs('TryScope-LoadLookupDataFromSharePointLists')

Which I am expecting to get the RAW JSON of any failed action within the TryScope.
When I force an error within the TryScope (I forced the SharePoint view to an invalid name .. thus the working call fails) the Catch Set_ErrorRAW shows a null result.
Here is the test run:
Catch on Output of Scope gets NULL.jpg
Now if instead of getting the output of the scope, if I get the output of the specific action, it works, but that means that I have to manually get the raw output, then parse it to see if it was the Action/Step that failed.  
Here is image showing calling outputs() of the fail action in the TryScope gets valid data in the Catch Scope.
Catch on Output of Failing Action withint the TryScope works.jpg
After all that .. here is my Question:
Is there a way to either:
  •  Get the error result as reported by the scope?
  •  Use a for-each to and walk through each Action within the scope so I can loop through the error handling...  something like
    • For Each Action in Scope X 
      • Compose from ErrorRaw
      • If status not equal to 200 then error occurred
      • if headers contains SPRequestGUID then SharePoint failure
        • Get headers:request-id, 
        • Confirm body:status = StatusCode
        • Get body:message
        • Test that body:message not null
        • Load all of that into Flow-wide ErrorCollect array variable


Callouts to people who might have already solved this...   @FlowJoe or @TomaszPoszytek 

I hope someone already has this, because hand crafting the error logic will be a big pain otherwise.
Thank you in advance! 



First, sorry for my late response 🙂

Regarding error handlings - instead of using "outputs('TryScope-LoadLookupDataFromSharePointLists')" function you should use result('TryScope-LoadLookupDataFromSharePointLists') and then parse the returned JSON. That fx returns all the execution details about each action inside the scope.


Please check out my post about it:


If you have more questions I am here to help 🙂






I'll try result now, thank you!



Result is working .. but the odd thing is the expression editor treats it like non-intelisense thing.


See imageNo result function in expression editor.jpg


See there is no Result .. removeProperty, replace, and range.. but that is it...

And after calling result, I have to build my own parse JSON to get status.


Maybe result() is a preview flow feature?


Thanks again!


Hey! Yes, that function from Logic Apps, but since Power Automate is built on top of them, you're able to use some of its features too 🙂




If you find my answer as a solution to your question please mark is as "answer" 🙂




Helpful resources

Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Users online (44,215)