Okta workflow get object with search key feature

Hello team. I have a response body that i need to parse. the issue is one field is an array that can vary in length… so I am unable to use the get object card with something like below…

field.11.value or field.10.value…

In JSON paths this is a valid way to search for example $.fields[?(@.name == ‘SomeDataKey’)].value

But it does not work in the okta workflow get object card… I would like to avoid iterates as there could be large amount of un-necessary processing…

I’d recommend continuing to use your Object Get or Get Multiple cards, but go ahead and “get” that array and treat it as a list.

It seems like from your example, you want all the values within the list that relate to that key? If so, you’d want to feed the list into a List - Pluck card and you can pluck all the values you need.

Alternatively, you could explore something like a List - Find card, etc.

If you have a more specific example of the JSON you are working with, and the values you need from it, I can try to show an example.

The Workflows Collection: Working with JSON KB has resources to learn about the cards Bryan mentioned.

This is the example of list/Object I am dealing with. It could have up to 50+ multi values arrays. I need to be able to find the value for RootRecordID which can appear at any position in those 50 values…

[
{
“parity”: true,
“displayName”: “Owned By Team”,
“uuid”: “sdrtygujsexdghckvjbk45687fhxcghck”,
“html”: null,
“name”: “OwnerTeam”,
“value”: “TestTeam”
},
{
“parity”: true,
“displayName”: “Description”,
“uuid”: “trdjstrdhb65789fjk46578yxgfhcgjv”,
“html”: null,
“name”: “Description”,
“value”: “Test”
},
{
“parity”: true,
“displayName”: “Root RecID”,
“uuid”: “eszfvghbjsrdytkfkl46578908fgchjg”,
“html”: null,
“name”: “RootRecordID”,
“value”: “9932332”
},
{
“parity”: true,
“displayName”: “Root TypeID”,
“uuid”: “xcgjklsrdklrfvhjkb45678946e578ch”,
“html”: null,
“name”: “RootTypeID”,
“value”: “fcghvjbxcgvhjke56ryug5768xfgchj”
},
{
“parity”: true,
“displayName”: “Root Type Name”,
“uuid”: “strdytfuygurdytfygujhkgfhk548fch”,
“html”: null,
“name”: “RootTypeName”,
“value”: “Incident”
}
]

You can use the List Find card to find the object you need out of the list.


excellent this works.

1 Like