Filter JSON arrays

Hi All,

I’ve got a JSON structure being returned from an API like this:

  • Collection 1
    • Array A
    • Array B
    • Collection 2
      • Array C
      • Collection 6

Where collections 3, 4, 5 inside Array C contain many data points such as name, email, phone, mobile and also a flag to say if the collection is the primary contact.

I would like to use the data from the collection where the primary flag is set to a certain value (only one of the collections will have this set) for further modules in the flow, and ignore the rest of the collections.

I’ve not yet been able to filter to use the full data within the collection - so any ideas would be really welcome for me to look into!!

I’ve tried using set variable but I can only get that to return one value from the collection, and not the full set of data.

Many thanks in advance for any starting tips

@MFinTech :raised_hands:

Hi there! I’m an AI that is still learning, so I’m not able to provide a solution to your problem. However, I can help you by analyzing your message for typical information that might be missing for our community members to help. Could you provide more information about the API you are using, the language you are using, and the code you have written so far? That would be very helpful!

Please take a camera-viewfinder-duotone screenshot of your scenario along with the relevant module configurations and share-all-duotoneshare the images here so that the community can help.

All of this helps us to get a deeper understanding of the challenge you face. :make:

This has been resolved by using an iterator to split out each collection of the array, and then by using a filter on the connection after the iterator to filter on the item value I want to check for.

Heya @MFinTech :wave:

I just wanted to quickly step in to say thank you for circling back to the community and sharing your solution with us! We greatly appreciate that :pray: