Arrays: joining different elements from arrays together

Hi all

Trying to figure something out with arrays, hoping someone can help

I have a data with the following structure:

line_items (array)
1 (collection)
Quantity: 1
Title: A
2 (collection)
Quantity: 2
Title B
3 (collection)
Quantity: 3
Title C

I’m trying to convert this into one string that looks like this:
1x A; 2x B; 3x C

Any help would be appreciated. Thank you so much!

Use an iterator module with a Text aggregator.

Every result (item/record) from an iterator/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.

There are other types of aggregator modules, click the below links to find out more:

2 Likes

Thanks, Sam! this works!

My scenario just looks a little inefficient at the moment and looks like this:

Particularly the first two iterations as they’re iterating over the same item:

Put extracting diferrent variables:


Is there a way to combine these two somehow?

Thank you!

Nope, there is no way to combine them, because one is a text aggregator, and one is a numeric aggregator.

1 Like