In my scenario my iterator has 20 bundles, but I only want the first 6 (based on a Airtable field variable earlier in the scenario) to be passed to create 6 new records in an Airtable table. How do I do this?
Thank you in advance for any help.
In my scenario my iterator has 20 bundles, but I only want the first 6 (based on a Airtable field variable earlier in the scenario) to be passed to create 6 new records in an Airtable table. How do I do this?
Thank you in advance for any help.
In your iterator, you can slice the first six items in the array using the built-in function slice
e.g.:
{{ slice(array; 0; 6) }}
For more information, see https://www.make.com/en/help/functions/array-functions#slice--array--start---end--
That’s beautiful! thank you. However, it passes the first bundle 6 times, not the first 6 bundles in the order. How do I accomplish that? Thanks
And if you want filter based on a mappable variable, use a filter before the itterator to only itterate the bundle based on your Airtable field.
Then use a filter behind the itterator to only pass the first 6 by using the bundle order position information.
And if that is also not what you are looking for, please share some screenshots so we can help you with a better understanding of your scenario.
You can’t use an iterator if you do not have an array.
To create an array first, you have to use an array aggregator.
Then, you can slice the first six items in the array in the iterator module so that the iterator module outputs six bundles.
Every result (item/record) from a search/match module will output a bundle. To “combine” them into a single structure, you’ll need to use an aggregator of some sort.
Aggregators are modules that accumulate multiple bundles into one single bundle. An example of a commonly-used aggregator module is the Array aggregator module. The next popular aggregator is the Text Aggregator which is very flexible and has applies to many use-cases.
thank you, but that just stops the scenario if the bundle count is greater than 6, it is an all or nothing kind of deal with iterator and the filter
Some scenarios need some extra creativity and love in filters and slicing to get the desired results.
I do think we might be able to help you if you share some screenshots or a video.
Combine all your bundles into an array using the Array Aggregator.
Use the slice built-in function with an Iterator module.
And use a filter for your Airtable field in the middle if you want the new array to be filtered based on an Airtable value.
I figured it out, I used a pre iterator id as opposed to the iterator value in the airtable field , now it posts the first 6 bundles! Thank you @samliew