Need to capture value from this complex JSON

How to get all status and id and name ( id and name are under permission_profile ) from the below API response.
Any help, please?

{
“users”: [
{
“id”: “11111111-1111-1111-1111-111111111111”,
“site_id”: 1,
“site_name”: “Demo”,
“user_name”: “John Doe”,
“first_name”: “John”,
“last_name”: “Doe”,
“user_status”: “active”,
“default_account_id”: “22222222-2222-2222-2222-222222222222”,
“default_account_name”: “Demo Enterprise”,
“language_culture”: “en”,
“selected_languages”: “en;”,
“is_organization_admin”: true,
“created_on”: “2020-02-05T12:47:59.177”,
“memberships”: [
{
“email”: “johndoe@example.com”,
“account_id”: “22222222-2222-2222-2222-222222222222”,
“external_account_id”: “3333333”,
“account_name”: “Demo Enterprise”,
“is_external_account”: false,
“status”: “active”,
“permission_profile”: {
“id”: 44444444,
“name”: “Account Administrator”
},
“created_on”: “2020-02-05T12:47:59.177”,
“groups”: [
{
“id”: 5555555,
“name”: “Administrators”,
“type”: 1
},
{
“id”: 6666666,
“name”: “Everyone”,
“type”: 2
}
],
“is_admin”: true
},
{
“email”: “johndoe@example.com”,
“account_id”: “77777777-7777-7777-7777-777777777777”,
“external_account_id”: “8888888”,
“account_name”: “Demo Inc - MyTask”,
“is_external_account”: false,
“status”: “active”,
“permission_profile”: {
“id”: 99999999,
“name”: “DS Power User”
},
“created_on”: “2022-10-26T16:08:41.577”,
“groups”: [
{
“id”: 10101010,
“name”: “Everyone”,
“type”: 2
}
],
“is_admin”: false
},
{
“email”: “johndoe@example.com”,
“account_id”: “44444444-4444-4444-4444-444444444444”,
“external_account_id”: “5555555”,
“account_name”: “Demo Inc - SirionLabs CLM Integration - Dev/Int”,
“is_external_account”: false,
“status”: “active”,
“permission_profile”: {
“id”: 66666666,
“name”: “DS Power User”
},
“created_on”: “2022-10-26T16:09:49.57”,
“groups”: [
{
“id”: 7777777,
“name”: “Everyone”,
“type”: 2
}
],
“is_admin”: false
},
{
“email”: “johndoe@example.com”,
“account_id”: “88888888-8888-8888-8888-888888888888”,
“external_account_id”: “9999999”,
“account_name”: “Demo Inc. - EWC”,
“is_external_account”: false,
“status”: “active”,
“permission_profile”: {
“id”: 101010101,
“name”: “Account Administrator”
},
“created_on”: “2022-11-07T21:06:30.233”,
“groups”: [
{
“id”: 11111111,
“name”: “Administrators”,
“type”: 1
},
{
“id”: 12121212,
“name”: “Everyone”,
“type”: 2
}
],
“is_admin”: true
},
{
“email”: “johndoe@example.com”,
“account_id”: “12121212-1212-1212-1212-121212121212”,
“external_account_id”: “13131313”,
“account_name”: “Demo Inc - HR EDM”,
“is_external_account”: false,
“status”: “active”,
“permission_profile”: {
“id”: 141414141,
“name”: “Account Administrator”
},
“created_on”: “2022-11-11T16:18:40.763”,
“groups”: [
{
“id”: 15151515,
“name”: “Administrators”,
“type”: 1
},
{
“id”: 16161616,
“name”: “Everyone”,
“type”: 2
}
],
“is_admin”: true
}
],
“identities”: [
{
“id”: “17171717-1717-1717-1717-171717171717”,
“provider_id”: “18181818-1818-1818-1818-181818181818”,
“user_id”: “11111111-1111-1111-1111-111111111111”,
“immutable_id”: “johndoe@example.com
}
],
“device_verification_enabled”: false,
“require_two_step_verification”: false,
“allow_two_step_verification_snooze”: false
}
]
}

@c3f1e68294fdcf4a1f0a817ca

first use a deserialize json activity and then from output use for for loop jobj("users")(0)("memberships").Cast(Of JObject) and inside loop use

  1. currentJObject("status").ToString
  2. currentJObject("permission_profile")("id").ToString
  3. currentJObject("permission_profile")("name").ToString

Implementation

output
image

Hope this helps

cheers

3 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.