SailPoint JSONPath Query

Hi,

I am trying to get a dynamic id value from a certain HTTP response in a SailPoint workflow. The Workflow setup is as follows: trigger → get HTTP data → use the HTTP data to assign the id value to a variable for later use in the workflow.

The JSON response from the HTTP Get operation is of the following format:

{
    "fields":[
         {
            "allowedValues": [
                {
                    "id": "12475",
                    "self": "12475",
                    "value": "APAC"
                },
                {
                    "id": "12476",
                    "self": "12476",
                    "value": "EUR"
                },
                {
                    "id": "12477",
                    "self": "12477",
                    "value": "US"
                }
            ],
            "fieldId": "10074",
            "hasDefaultValue": false,
            "key": "10074",
            "name": "field_10074",
            "operations": [
                "set"
            ],
            "required": true,
            "schema": {
                "custom": "custom",
                "customId": 10074,
                "type": "type"
            }
        }
    ]
}

What JSON Path can I use to get the id value “12475”? Other JSON Path tools indicate that the following query should return “12475”:
$.fields[?(@.key==‘10074’)].allowedValues[?(@.value==‘APAC’)].id

However, in SailPoint this has not been the case. It makes me think that SailPoint has a custom built JSON path interpreter that differs from others.

Hi @dominick-miller ,

The below JSON path you have provided contains a conditional search

$.fields[?(@.key == “10074”)].allowedValues[?(@.value == “APAC”)].id

Conditional search always a return results in arrays, in the above case it is:

[
“12475”
]

Whereas, the json path query used with array index gives the string result value
$.fields[0].allowedValues[0].id

However, I understand that you need to use a query expression for your results which would result in a list of values. I suggest you to use the loop here and provide the query as the input to the loop.

This would provide you the actual value inside the loop as loopInput which can be used for your solution. Hope it helps.

Regards,
Uday Kilambi

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