I am trying to extract the anchor text and href from a list of anchor tags. This is the relevant part of the automation:
The first part parses out the anchor text:
The second part parses out the href:
However, as you can see the first module uses one operation while the second one uses three for the exact same XML. This gets out of hand very fast since I need to parse hundreds of cases. Why does it do this and how can I correct it?
Welcome to the Make community!
This is because the first module outputs three results (bundles), so future modules run once per result unless you are combining the results into an array.
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:
Example
Here is an example of how your scenario could look:

This is just an example. Your final solution may or may not look like this depending on your requirements and actual input data.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.
3 Likes
Ah, this makes sense. Thanks!
1 Like