Extract few collection's data peaces into one cell in google sheets and saparate them by comma (,)

I have a an E-commerce website and when someone buy few product I get them as few collections.

My quastion is how to extract specific data from all the collections (such as the ccollection product name) so when someone make a purchase I create a new row in my google sheets (I have already succeeded in this) and put all these product names into one cell in and saparate them by comma (,) withins this cell (the products name cell) - that’s my big challange…

Hello,

You should be able to use a Text Aggregator here.
Place the module after your e-commerce module, select your e-commerce module as the source, and use a comma as a separator. You may need to show the advanced options to get the output you need.

2 Likes

Hey @Donald_Mitchell - thanks for reaching out. the thing is that I have tried the Text Aggregator after the source module but this act decrise my ability to extrat more details from the source module when I configured the google sheet modulke (the last module). instead of show me a lot of data options from previous modules it showed me just the peice of data I have aggregated in the Text Aggregator module.

Ah, yes, then in this case you can use an Array Aggregator instead of Text Aggregator.
Then, in Array Aggregator, select all the pieces of data you’ll need, or select all of them.
That should leave you with a complex array.
Then, you can use the map() function on the array in subsequent modules.
The result of map() is an array, on which you can then perform other functions and calculations.
In this case since you want a CSV, you can try a join() function and specify comma as the separator.

2 Likes

My apologies, after looking at your last screenshot, I realize you don’t need any aggregator. You can just go straight to using the map() function.

So if you’re dealing with output that looks like this:

And you want to get output like this:

Here is now you could use the join() and map() functions together:

Please see this blueprint so you can get an idea on how it works.
I tried to mimic your data structure as best I could.

Hope this makes sense and hope it helps!

2 Likes

Hey @Donald_Mitchell big thanks for investing in writing more!

Now I face a new challenge. I want to gather all the products so that they are written in this way:
Conceive & Believe - 70X100 * 2 , Purple Ace - 70X100 * 4.

While the * 2 / * 4 - are the quantity of the product the customer has purchased (another variable within the same collection).

Is there any way to join the products + quatity of each product (right after the proudust name)?

Now you can use an Iterator with a Text Aggregator.

Your Iterator would iterate on your Array just under Bundle 1 in your screenshot.
For the Text Aggregator you’ll be using for the Text: value.name * value.quantity
The Row separator is Other, because you want to specify a comma.
The source is the Iterator.
image

I updated the quantity of Purple Ace to 3 so we can see that the correct quantities are being pulled for each product.

I’ve attached an updated Blueprint so you can see how this new part works.

There’s another way to do this without the Iterator, but it’s more confusing and not that practical to use it.

product quantity csv.json (18.2 KB)

1 Like

@Donald_Mitchell - It worked!
your are the man! Thanks

1 Like