If I have an array like:
{
"Available": [
{
"id": "f641c5bb-0e2b-4391-b311-9e60751b1cca",
"qualifications": [
"Training"
]
},
{
"id": "77e8aebf-28fd-4906-b602-353fbd40b298",
"qualifications": [
"Game Master",
"Training"
]
},
{
"id": "100a3a3e-3bce-4bf1-960e-129ceb3f5676",
"qualifications": [
"Game Master",
"Performance"
]
},
{
"id": "ec3ee631-c822-4bf8-bd11-899a3f3c20d6",
"qualifications": [
"Training"
]
},
{
"id": "4243d471-47c0-414c-88b7-5a948418acc7",
"qualifications": [
"Performance"
]
},
{
"id": "827b4ad7-26e8-428b-b3df-da537c1b42b4",
"qualifications": [
"Training"
]
},
{
"id": "13b66ae2-723e-442f-9ca5-19fd152a6033",
"qualifications": [
"Game Master"
]
},
{
"id": "3a06d885-22b2-48ed-881b-ae096d725b07",
"qualifications": [
"Game Master",
"Performance"
]
}
]
}
How can I fetch all of the IDs of items in the array whose qualifications array contains “Game Master”?
{{map(1.Available; "id"; "qualifications"; "Game Master")}} seems to work but only if the qualifications array only includes 1 item which is Game Master and doesn’t work if the qualifications array contains any other items.
I’m trying to do this in a map function to avoid wasting operations, as I need to extract 6 sets of these IDs. The fact that this filter works in some scenarios makes me optimistic that this will be possible…
I do have some control over the structure of the data but I also need to be able to count the number of items in the array whose qualifications array contain certain values so this is the structure that I’ve landed on.
Simple blueprint for testing - blueprint (20).json (5.3 KB)


