Aggregator is a type of module designed to merge several bundles of data into a single bundle.
When an aggregator is executed, it:
The following image shows a typical setup of the Array aggregator module:
The module from which the bundle aggregation will start. The source module is usually an iterator or a search module that outputs a series of bundles. Once you setup the aggregator's Source Module (and close the aggregator's setup), the route between the source module and the aggregator will be wrapped in a grey area to visualize the start and the end of the aggregation.
|Target structure type||
[only applicable for the Array aggregator module] The target structure into which the data shall be aggregated. The default option is Custom that enables you to choose items that should be aggregated into the Array aggregator's output bundle's
Once you connect more modules after the Array aggregator module and get back to the module's setup, the Target structure type dropdown will contain all following modules and their fields that are of type Array of Collections, like e.g. Attachments field of the Slack > Create a Message module:
The video below explains how the modules connected after an Array aggregator affects the content of Target structure type dropdown:
The aggregator's output can be split into several groups with the help of the Group by field. The Group by field can contain a formula that is evaluated for each aggregator's input bundle. The aggregator then outputs one bundle per each distinct formula's value. Each bundle contains two items:
|Stop processing after an empty aggregation||
By default, the aggregator outputs the result of the aggregation even in case no bundles reached the aggregator (e.g. because they have been all filtered out on their way). If the Stop processing after an empty aggregation option is enabled, the aggregator will not produce any output bundle in this case and the flow will stop.
The video below is module 2 of the 3 part lesson titled Iterator and Array Aggregator. It is a continuation of module 1 (video link) and using a sample scenario, explains when to use an Array aggregator and what to do with the output.
Use Case: Zipping all email attachments and uploading the ZIP to Dropbox
The scenario below shows how to:
Attachments, which is an array containing all the email's attachments.
Attachmentsarray one by one and sends them further as separate bundles.