I have data coming into a scenario as bundles with multiple properties. One of those properties is an array of collections as follows:
I need to filter the bundles prior to the next module on only bundles that have Details that have a collection where the display_value property CONTAINS “Sales - League Bowling”. Since the array is not just a simple array of strings, none of the array functions seem to help me. I can fetch the first collection of the array and test its display_value property using the GET function but the values I’m seeking are not always in the first collection of the array. I tried using the MAP function but it only provides for an EQUALS operator and doesn’t provide a way to use a CONTAINS operator.
Does anyone know how I can get a filter module to test into a collection within an array of the bundle, or perhaps flatten the array - collection so I can use simple text functions like CONTAINS?
Hi @Jerry_Johnson, welcome to the Make Community!
If all you care about is the display_value but not the ID, then this might be one option for you… add an Iterator and Iterate on the Details array from your bundle.
Add an Array Aggregator after the Iterator and select just the display_value as the value to aggregate.
This will leave you with an array of “display_value” values.
Use another Iterator to Iterate on that array of display_values, followed by another Array Aggregator with a “contains” filter between them.
Only those items that contain the text you enter will be aggregated.
If you want to get all “display_value” where display_value contains “Sales - League Bowling” from ALL bundles, there’s a slightly different way to handle that. It depends what you need to do with the information once you’ve extracted it.
4 Likes
Fantastic, I hadn’t worked through the iterator back to aggregator scenario the way you described it. Thank you for the assist.
1 Like