Mapping Nested Array with Index Instead of Keys, Returning Higher Level Value

Greetings All,

I’m attempting to pull and map some data from a very deeply nested array and I’m finding myself stuck. Pretty sure it can be done, but I’m not terribly skilled at referencing complex data structures, especially within the map() function.

Here is my incoming data (redacted for sensitivity):

My goal:

Return the index value (circled), when item 1 in the array below it is equal to 364.

I’ve tried a few different versions and iterations of this function, to no avail:

Note that the 3.7 Body.value is the result of entering: {{37.body.value.1.values.1[}}

I think this is doable within a function, but I can’t quite get it sorted. Thank you in advance!!

Canyou share the JSON string here…

Hi @Caleb_Theriault, you can try this formula:

{{map(37.body.value; "index"; "values.1"; 364)}}

This will extract index from the array value where first item in array values is equal to 364.

Note that it will also return an array of indexes. If you only expect to have one matching item, you can wrap the whole formula inside first() like this:

{{first(map(37.body.value; "index"; "values.1"; 364))}}

If this doesn’t solve the issue, could you show some more sample data?

Cheers!