Aggregator is confusing me

I used to be pretty good with BASIC on my Commodore 64, but haven’t built on that much since people stopped wearing onions on their belts.

I have an array of strings. I need to manipulate those strings and i’d like to make a new array of the modified strings for other things…and i can’t figure out what I’m doing wrong.

Alternatively, is there a way of running string functions on the items in an array without iterating it first? Claude tells me there is with the map function, but I get that to work either.

So…

I’m pulling data from an api (the ‘cpcclassificationBag’)

. I need to do some string manipulation of the items (unshown) so I use the iterator module

and process the strings. I’d like to put those new strings into an array to get rid of duplicates and do some other array stuff. So i grab the aggregator module
and it kinda looks like it worked, but when I look at the array in google sheets

I see the new array’s items each have added information
Screenshot 2025-06-09 at 8.31.24 PM

Please point me in the right direction.

well, that last bit came out a bit small.
The first item as it comes from the api is A47J 43/0716. The same item after being iterated and aggregated is {“value”:“A47J 43/0716”}

Hi @Steve_O_Donnell ,

What?! Have people stopped wearing onions on their belts? When did this happen? I need to update my wardrobe, stat.

In exchange for your useful fashion tips, I will attempt to solve the riddle of the array…

Basically the array aggregator is actually returning a Collection, not an Array. The Collection only has one value in it, conveniently called “value”. Claude is right, you need to use the map() function to convert the collection to an array.

You just need to add a map() function in your final Google Sheets module:

image

If this solved your problem, please mark this as the solution.

Kind regards, Terry.

2 Likes