- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 08:42 AM
Hello All,
I've created a flow designer action that gets me devices from the microsoft intune graph API. I get the expected result, but I am unable to extract specific values from the response body.
The script step to get the value "id" from the JSON object looks like this:
However, this does not get me any output value:
I think it has something to do with the JSON object being an "OData" Object, because if I test the script step with the response body cut off of these @odata.context values (and therefore having a "normal" JSON object, it works.
Here is how the JSON Response body looks like (I removed some value pairs for readability):
{
"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#deviceManagement/managedDevices",
"@odata.count":1,
"value":[
{
"id":"xxx-xxx",
"userId":"yyy-yyy",
"deviceName":"X",
"managedDeviceOwnerType":"company",
"enrolledDateTime":"2020-04-22T05:27:38Z",
"lastSyncDateTime":"2020-07-23T14:01:21Z",
"operatingSystem":"Windows",
"complianceState":"compliant",
"jailBroken":"Unknown",
"managementAgent":"configurationManagerClientMdm",
"osVersion":"10.0.18363.959",
"deviceActionResults":[
],
"configurationManagerClientEnabledFeatures":{
"inventory":true,
"modernApps":true,
"resourceAccess":true,
"deviceConfiguration":true,
"compliancePolicy":true,
"windowsUpdateForBusiness":true
}
}
]
}
How can I get specific values from this response body? E.g. "id" oder "deviceName"?
Thanks!
Solved! Go to Solution.
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 09:46 PM
Hi
Instead 'responseObject.id' in script try following,
responseObject.value[0].id; and same for devicename. You need to follow the correct path as 'id' reside inside 'value'.
Please mark correct & helpful if that works.
Regards
Deepen shah
aavenir.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 09:46 PM
Hi
Instead 'responseObject.id' in script try following,
responseObject.value[0].id; and same for devicename. You need to follow the correct path as 'id' reside inside 'value'.
Please mark correct & helpful if that works.
Regards
Deepen shah
aavenir.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 02:21 AM
Perfect, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 10:22 AM
Hi Deepen,
Can you please tell me how to call '@odate.count' in script . Like responseObject.value[0].id;