Power Automate Error Exception
In Power Automate, the expression:
is used to retrieve the error message from a failed action—typically inside a Scope, Try/Catch pattern, or Configure run after setup.
What This Expression Does
-
actions('Try') → Refers to the action named Try (usually inside a Try scope).
-
?['error'] → Safely navigates to the
errorobject (using?prevents failure if it doesn't exist). -
?['message'] → Retrieves the actual error message string.
So effectively, this expression gives you the error message produced by the Try action.
π§© Where You Use This
Typically inside the Catch scope of a “Try → Catch → Finally” pattern in Power Automate:
-
Create a Scope called Try
-
Create a Scope called Catch
-
Set Catch to run only when Try has failed
-
Inside Catch, use the expression above to extract the error
π Example: Compose Action Inside Catch
Add a Compose action and insert:
This gives you something like:
π Safe Navigation (Why the ?)
Using ? prevents your flow from failing if:
-
There is no error object
-
The action didn't produce a message property
Without ?, your flow may fail trying to access a missing property.
π Notes
-
The action name must match exactly (case-sensitive).
-
You can also retrieve:
-
Error code →
actions('Try')?['error']?['code'] -
Error details →
actions('Try')?['error']?['details']
-
Comments
Post a Comment