Aggregator creating multiple bundles

Hi.

I’m fairly new to Make, so I would love some advice.

I’m creating an automation in which I use an iterator to split an array of text into bundles before passing them through several OpenAI modules.

I then want to put all of that information into a single bundle, before placing it in a Google Doc. I know I need to use an aggregator for this.

However, when I add my aggregator to my scenario, it doesn’t “collect” my bundles passing through the Open AI modules and instead creates multiple Word documents.

I’ve tried changing all the configurations, but nothing seems to be helping.

I’ve noticed my aggregator is shaded and linked to the set variable module just before it, so I think it’s caught in the iterator loop. However, I can’t seem to break it. I’ve tried using a router, filters, deleting the module, then adding a new one outside the workflow and linking it that way.

I have two scenarios, this is doing it on and have tried testing the flow. On the first one, the flow actually shows the aggregator “storing” the information, but it still creates multiple Google documents. On the second, it doesn’t even store it and passes each bundle straight through to the Google doc.

As it’s happened twice, I know I must be doing something wrong, but I’ve hit a wall with what to do.

This is my Aggregator settings, by the way, in case that helps.

Any suggestions?

For simplicity, If you can, just put all the data in Google sheet and use the search rows module which is an inbuilt iterator. that’s not the only way to solve the issue you’re facing but it’s the least complicated solution.

Hey Jessica,

can you show the entire scenario? This behavior usually happens when you have the wrong source module in the Aggregator settings.

Welcome to the Make community!

Setting the Correct Aggregator Source

You need to set the “Source Module” field of the aggregator to where the bundles are coming from. This is usually an iterator module, but can also be a search/list/repeater module, or even the trigger module!

Combining Bundles Using Aggregators

Every result (item/record) from trigger/iterator/list/search/match modules will output a bundle. This can result in multiple bundles, which then trigger multiple operations in future modules (one operation per bundle). To “combine” multiple bundles into a single variable, 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 can apply to many use-cases like building of JSON, CSV, HTML.

You can find out more about the other types of aggregator modules here:

Question: Which is the best aggregator do you think you’ll need for your use-case?

Mapping a Specific Structure Into a Complex Field

If you have an array of collections, in programming terms, this is called an array of objects, or an array with non-primitive data types (“complex”).

The Array Aggregator module is very powerful because it allows you to build a new complex array of collections that matches a later module’s field to map multiple items (collections) to it. Such fields initially would allow you to manually add items, but you can toggle the “Map” switch to the “on” state and map a whole array into a single field.

This is done by selecting the “Target structure type” in an Array Aggregator module.

As you can see from the above example, the “Map” toggle on complex fields are used when you have an array variable (like from an array aggregator). Other combinations of modules may also allow you to generate an array that matches a future field’s array structure, like “Aggregate to JSON + Parse JSON”, or “Create JSON + Parse JSON”, but this is an advanced topic.

Question: Are you mapping your array into a field that accepts more than one item/collection?

Example

Here is an example of how your scenario could look like:

This is just an example. Your final solution may or may not look like this depending on your requirements and actual data.

For more information, see “Mapping with arrays” in the Help Centre. You should also do the Make Academy, which also covers the use of Iterators & Aggregators.

Hope this helps! Let me know if there are any further questions or issues. P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

@samliew

It’s not the iterator causing the issue; it’s the aggregator. Already using a Google Sheet module at the start.

Not a problem! It’s a long scenario, so you may need to zoom.

Any idea on the aggregator configuration? The flow looks right, but still not working.

Thanks for your help. I’ve completed the Make Academy but still struggling with this issue.

The text in your screenshot is unreadable.

Could you manually re-arrange your modules so that it has maximum 8 per row, stacked below each other? Like this, but without unlinking any modules:

Then, in this order,

  1. maximise your browser window,
  2. run your full scenario once,
  3. zoom in so that all the modules are as large as possible (but still within the window), and then
  4. take a screenshot of the full scenario with the output bundle “speech bubbles”.

@samliew

Best guess - the iterator is not doing anything and it’s another module producing the extra bundles. Can you show the same screenshot but from the scenario history so we can see what is processing how many bundles?

You don’t need the iterator there. Switch the source module of the text aggregator to the parser instead. This is the module producing the extra bundles.

1 Like

I need the iterator because it’s splitting my data into sections. I need it to process each bundle individually.

That worked! Thank you so much for your help!

1 Like