web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Parse JSON - extract s...
Power Automate
Unanswered

Parse JSON - extract single values

(0) ShareShare
ReportReport
Posted on by 2

Hi all

I want a flow that sends a mail to a helpdesk when something fails.
I'm able to retrieve the flow error details (compose error details step) and also parse the JSON.

I want three things in the mail (they are in bold in the example below)

Name = flow step failed
Entityname = specific table
Message = reason flow failed

If I add these values to another step it automatically creates a for each action which I don't want. Does someone have a solution to end up with a single value for these three? I tried with first() but this did not work.

 

 
ChewBackah_1-1700201188671.png

 

 

{
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"inputs": {
"type": "object",
"properties": {
"host": {
"type": "object",
"properties": {
"apiId": {
"type": "string"
},
"connectionReferenceName": {
"type": "string"
},
"operationId": {
"type": "string"
}
}
},
"parameters": {
"type": "object",
"properties": {
"entityName": {
"type": "string"
},
"recordId": {
"type": "string"
}
}
}
}
},
"outputs": {
"type": "object",
"properties": {
"statusCode": {
"type": "integer"
},
"headers": {
"type": "object",
"properties": {
"Cache-Control": {
"type": "string"
},
"x-ms-service-request-id": {
"type": "string"
},
"Set-Cookie": {
"type": "string"
},
"Strict-Transport-Security": {
"type": "string"
},
"REQ_ID": {
"type": "string"
},
"CRM.ServiceId": {
"type": "string"
},
"AuthActivityId": {
"type": "string"
},
"x-ms-dop-hint": {
"type": "string"
},
"x-ms-ratelimit-time-remaining-xrm-requests": {
"type": "string"
},
"x-ms-ratelimit-burst-remaining-xrm-requests": {
"type": "string"
},
"OData-Version": {
"type": "string"
},
"X-Source": {
"type": "string"
},
"Public": {
"type": "string"
},
"Date": {
"type": "string"
},
"Allow": {
"type": "string"
},
"Content-Type": {
"type": "string"
},
"Expires": {
"type": "string"
},
"Content-Length": {
"type": "string"
}
}
},
"body": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
}
}
}
},
"startTime": {
"type": "string"
},
"endTime": {
"type": "string"
},
"trackingId": {
"type": "string"
},
"clientTrackingId": {
"type": "string"
},
"clientKeywords": {
"type": "array",
"items": {
"type": "string"
}
},
"code": {
"type": "string"
},
"status": {
"type": "string"
}
},
"required": [
"name",
"inputs",
"outputs",
"startTime",
"endTime",
"trackingId",
"clientTrackingId",
"clientKeywords",
"code",
"status"
]
}
}
Categories:
I have the same question (0)
  • grantjenkins Profile Picture
    11,063 Moderator on at

    Are you able to provide a sample of the actual output? What you've provided is just the schema without any actual data so difficult to understand the right expressions, etc.

  • ChewBackah Profile Picture
    2 on at

    Yes ofcourse

     

    This is the sample.

     

    [
     {
     "name": "Een_rij_bijwerken",
     "inputs": {
     "host": {
     "apiId": "subscriptions/3a3c8f3a-b051-4389-add3-35f0cadf681c/providers/Microsoft.Web/locations/westeurope/runtimes/europe-002/apis/commondataserviceforapps",
     "connectionReferenceName": "shared_commondataserviceforapps",
     "operationId": "UpdateRecord"
     },
     "parameters": {
     "entityName": "accounts",
     "recordId": "gegegee"
     }
     },
     "outputs": {
     "statusCode": 400,
     "headers": {
     "Cache-Control": "no-cache",
     "x-ms-service-request-id": "c49fb340-daae-4e81-8dc7-42e9764dd5b7,3503cb02-9a96-4893-9ec7-f2967cd674ff",
     "Set-Cookie": "ARRAffinity=42c3fe55459896d66940089b6ee2813436511067a378da57ae5b0812018c1f4215134d20c556b0b34b9b6ae43ec3f5dcdad61788de889ffc592af7aca85fc1c508DBE73AEE9BE7891195960092; path=/; secure; HttpOnly,ReqClientId=7cb3a547-3f59-49f2-9a6b-c248add17728; expires=Fri, 17-Nov-2073 06:30:50 GMT; path=/; secure; HttpOnly,ARRAffinity=42c3fe55459896d66940089b6ee2813436511067a378da57ae5b0812018c1f4215134d20c556b0b34b9b6ae43ec3f5dcdad61788de889ffc592af7aca85fc1c508DBE73AEE9BE7891195960092; path=/; secure; HttpOnly",
     "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
     "REQ_ID": "3503cb02-9a96-4893-9ec7-f2967cd674ff",
     "CRM.ServiceId": "framework",
     "AuthActivityId": "1019898e-830a-435c-9574-133d4559525f",
     "x-ms-dop-hint": "4",
     "x-ms-ratelimit-time-remaining-xrm-requests": "1,199.30",
     "x-ms-ratelimit-burst-remaining-xrm-requests": "7998",
     "OData-Version": "4.0",
     "X-Source": "221173246158230105901131912168154115120421812441386213712935159134818524773123735229,9176161242139420420213993493223518013014249371431123255838118226151239243105124",
     "Public": "OPTIONS,GET,HEAD,POST",
     "Date": "Fri, 17 Nov 2023 06:30:49 GMT",
     "Allow": "OPTIONS,GET,HEAD,POST",
     "Content-Type": "application/json; odata.metadata=full",
     "Expires": "-1",
     "Content-Length": "80"
     },
     "body": {
     "error": {
     "code": "0x80060888",
     "message": "Bad Request - Error in query syntax."
     }
     }
     },
     "startTime": "2023-11-17T06:30:49.9571792Z",
     "endTime": "2023-11-17T06:30:50.0792799Z",
     "trackingId": "6c34f2ce-1df4-4377-b1a9-cfc414d75705",
     "clientTrackingId": "08585014426967068126178557053CU146",
     "clientKeywords": [
     "testFlow"
     ],
     "code": "BadRequest",
     "status": "Failed"
     },
     {
     "name": "Een_gebonden_actie_uitvoeren",
     "startTime": "2023-11-17T06:30:50.0913838Z",
     "endTime": "2023-11-17T06:30:50.0922117Z",
     "trackingId": "abc29fa3-1d2b-4acb-8bc3-b08998167ef2",
     "clientTrackingId": "08585014426967068126178557053CU146",
     "clientKeywords": [
     "testFlow"
     ],
     "code": "ActionSkipped",
     "status": "Skipped",
     "error": {
     "code": "ActionConditionFailed",
     "message": "The execution of template action 'Een_gebonden_actie_uitvoeren' is skipped: the 'runAfter' condition for action 'Een_rij_bijwerken' is not satisfied. Expected status values 'Succeeded' and actual value 'Failed'."
     }
     }
    ]

     

  • grantjenkins Profile Picture
    11,063 Moderator on at

    If you're trying to get details from the first item then you should be able to use the following. Note that you'd need to change outputs('Compose') to the appropriate action your data resides in.

     

    //Name
    first(outputs('Compose'))?['name']
    
    //Entity Name
    first(outputs('Compose'))?['inputs/parameters/entityname']
    
    //Message
    first(outputs('Compose'))?['outputs/body/error/message']

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard