Merging multiple bundles into one?

:bullseye: What is your goal?

Hi guys, here is my scenario problem: scraping websites for info, then accessing multiple links (6) from that website to get everything I need. In the end I need to merge all 6 info bundles into one in order to send a full email but can’t figure out how to do that.

:thinking: What is the problem & what have you tried?

Tried Set Variable, Parse JSON, functions. Anything I do, the email module acts 6 times and not once after all the info is stored somewhere.

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

1 Like

Hello,

You must use Array Aggregator or Text Aggregator to merge your bundles.

The tricky part about why it is not working for you- the aggregator must be connected with the module that creates separate bundles.

You posted onlu part of your scenario, but I can assume your Text Parser [5] is creating separate bundles, so the Aggregator module should be linked to this module.

Use type of module which will suits your needs most- if you want to merge GPT output- probably it will be Text Aggregator

If this solves your problem, please mark the reply as “Solution”.

Have a nice day,
Michal

2 Likes

Welcome to the Make community!

Simply put, you’ve selected an incorrect “Source Module” in your Text Aggregator. It should have pointed to where the bundles are coming from— your first Text Parser module.

Which module are the multiple bundles are being generated from?

You can tell at which point in the scenario the multiple bundles are being generated, by looking at the previous module before the subsequent modules run more than once (due to multiple INPUT bundles).

The culprit is the Text Parser module, so you need to set the Source Module of aggregators to this Text Parser.

Combining Bundles Using Aggregators

Every result/item from some module types (like Trigger / Iterator / List / Search / Match modules) can potentially and likely output more than one bundle. These multiple bundles will individually run subsequent modules once per bundle, which is not optimal in most cases:

  • one operation per bundle per module, which could lead to…
  • use of multiple credits per bundle per module (some modules use more than one credit)
View example screenshots

Aggregator Example

The “Search Rows” module runs one time, returning 999 results (999 bundles).

  • Without Aggregator: the tools module run 999 times (999 operations)


    (and if there are more modules, they run 999 times each)

  • With Aggregator: the tools module only runs 1 time (1 operation)

:warning: Warning: :police_car_light:
This can easily use your entire quota of credits if you are not careful or fail to understand this concept.

To “combine” multiple bundles into a single variable, so that you can process all of the items in a single operation, you’ll need to use an aggregator. Aggregators is a type of module that accumulates bundles and outputs one bundle (unless you are using “Group By”). An example of a commonly-used aggregator module is the Array aggregator module.

You can find out more about some other aggregator modules here:

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

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!

Example

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

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

For more information, see “Mapping with arrays” in the Help Centre. I also suggest going through the Make Academy, which also covers the use of Iterators & Aggregators.

— @samliew

1 Like

After seeing your explanation, now I look stupid. Thanks for it, everything works now!