Hello,
I need to get "id" parameter as a variable(Initialize Variable) from following JSON output of MSFT Graph API. Please help.
"id": "AAMkADxxxxxxxxxxxxxxxxxxNgBGAAAAAAA4KpCwRxxxxxxxxxxxxxxxxxxxxxxxpQQYAAAAN60Axxxxxxxxxxxd4TL0Efpe__dRVAAK5zvX6AAA="
{
"statusCode": 200,
"headers": {
"Transfer-Encoding": "chunked",
"Vary": "Accept-Encoding",
"Strict-Transport-Security": "max-age=31536000",
"request-id": "954b8428-xxx-xxxx-xxxx-27152a497dee",
"client-request-id": "954b8428-xxx-xxxx-xxxx-27152a497dee",
"x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"South India\",\"Slice\":\"E\",\"Ring\":\"3\",\"ScaleUnit\":\"000\",\"RoleInstance\":\"MA1PExxxxxx12F7\"}}",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "true",
"Cache-Control": "private",
"Date": "Tue, 23 Feb 2021 20:08:09 GMT",
"Content-Type": "application/json; odata.metadata=minimal; odata.streaming=true; IEEE754Compatible=false; charset=utf-8",
"Content-Length": "1463"
},
"body": {
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('1f020274-xxxx-xxxx-xxxx-8bc529c82f91')/mailFolders('SentItems')/messages(id,toRecipients,ccRecipients,from,importance,hasAttachments,subject,createdDateTime,receivedDateTime,internetMessageId,isRead,attachments(size,isInline,lastModifiedDateTime))",
"value": [
{
"@odata.etag": "W/\"Cxxxxxxxxxxxzemcid4TL0Efpe++dRVAAK4f0SL\"",
"id": "AAMkADxxxxxxxxxxxxxxxxxxNgBGAAAAAAA4KpCwRxxxxxxxxxxxxxxxxxxxxxxxpQQYAAAAN60Axxxxxxxxxxxd4TL0Efpe__dRVAAK5zvX6AAA=",
"createdDateTime": "2021-02-23T19:39:38Z",
"receivedDateTime": "2021-02-23T19:41:34Z",
"hasAttachments": false,
"internetMessageId": "<PN1PR01xxxxxxxxxxxxB88C1F8809@PN1PR0101MB1517.INDPRD01.PROD.OUTLOOK.COM>",
"subject": "xxxxxxxxxxxxxxxxxxxxx",
"importance": "normal",
"isRead": true,
"from": {
"emailAddress": {
"name": "Ankit Shah",
"address": "xxxxx@xxxxxxxxx.com"
}
},
"toRecipients": [
{
"emailAddress": {
"name": "xxx xxx",
"address": "xxxx.xxxx@xxxxxxxxxxx.com"
}
}
],
"ccRecipients": [],
"attachments": []
}
],
"@odata.nextLink": "https://graph.microsoft.com/v1.0/me/mailFolders('SentItems')/messages?%24select=Id%2cToRecipients%2cCcRecipients%2cFrom%2cImportance%2cHasAttachments%2cSubject%2cCreatedDateTime%2cReceivedDateTime%2cInternetMessageId%2cIsRead&%24expand=Attachments(%24Select%3dSize%2cIsInline%2cLastModifiedDateTime)&%24top=1&%24skip=1"
}
}
Solved! Go to Solution.
Use this expression:
outputs('JSON')['body']['value'][0]['id']
You will need to adjust it so that outputs('JSON') is changed to whatever you are getting that JSON from.
Can you use ParseJSON action and use the above JSON to generate Schema? Then use Compose and Id from ParseJSON action?
Use this expression:
outputs('JSON')['body']['value'][0]['id']
You will need to adjust it so that outputs('JSON') is changed to whatever you are getting that JSON from.
@Paulie78 Thanks, that expression helped me.
@PrasadAthalye Thank you, but I am getting error while using the same method you described, please see attached photo.
So did your issue resolve with the solution @Paulie78 provided?
Check out new user group experience and if you are a leader please create your group
See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.