Using HTTP response body data in workflow

I saw this closed thread:

[
    {
        "description": "Supporters of the Empire who also do IAM.",
        "owner": {
            "displayName": "IdentityNow Admin",
            "emailAddress": "[email protected]",
            "type": "IDENTITY",
            "id": "fsdfsdfdsfdsfdsafd",
            "name": "idn_admin"
        },
        "memberCount": 8,
        "connectionCount": 1,
        "id": "fb98360b-8f5a-41cb-8834-0723a2eee022",
        "name": "Empire IAM Team",
        "created": "2022-09-09T19:56:04Z",
        "modified": "2022-09-09T19:56:04Z"
    }
]

Wondering if someone can help me understand something. Am I not able to parse out specific values from a response body of an HTTP operation? When I use something like $.httpRequest.body I get the whole response body. When I try to pull out a value from the response like $.httpRequest.body.name there is no data.

Is this possible in the way I described above? I’m going to play with variable creation and get creative, but wanted to make sure I’m not missing something simple.

1 Like

Hi @cassidiopia,

Are you trying to pass $.httpRequest.body.name into a webhook and trying to see the output.? If so, you would get a null result as the value is not an array structure and cannot be passed as a JSON.

If you can explain the bigger picture of what you are trying to achieve here, it would be of more help.

1 Like

Hi @cassidiopia,

It’s depends your http response structure.
For example if you have a body like this :



[
    {
        "description": "Supporters of the Empire who also do IAM.",
        "owner": {
            "displayName": "IdentityNow Admin",
            "emailAddress": "[email protected]",
            "type": "IDENTITY",
            "id": "fsdfsdfdsfdsfdsafd",
            "name": "idn_admin"
        },
        "memberCount": 8,
        "connectionCount": 1,
        "id": "fb98360b-8f5a-41cb-8834-0723a2eee022",
        "name": "Empire IAM Team",
        "created": "2022-09-09T19:56:04Z",
        "modified": "2022-09-09T19:56:04Z"
    }
]

It’s an array, if you want to access name you must do :

 $.httpRequest.body[0].name
4 Likes

Thank you so much, @baoussounda! Didn’t even notice that because I was calling a specific object, but it was using a list call so…makes sense!

Appreciate the extra eyes!

3 Likes

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