Combine multiple items from an array to a single text

What are you trying to achieve?

I’m trying to combine multiple items from a collection inside an array to a single text to be added to a google spreadsheet.

What I have is:

[
{
“status”: “success”,
“allIdeas”: {
“results”: [
{
“id”: “720eb9314f1e366a9700aab4b1a4430a-us”,
“keyword”: “italian pasta salad”,
“country”: “us”,
“difficultyLabel”: “Hard”,
“volumeLabel”: “MoreThanTenThousand”,
“updatedAt”: “2024-06-26T15:10:52Z”
},
{
“id”: “aa1c8c50fceb02fed82bbd9a9e312688-us”,
“keyword”: “italian pasta”,
“country”: “us”,
“difficultyLabel”: “Medium”,
“volumeLabel”: “MoreThanOneThousand”,
“updatedAt”: “2024-06-26T17:03:58Z”
},
{
“id”: “5eacf787cbb363d0b8cb7a1ab756f504-us”,
“keyword”: “italian pasta salad recipe”,
“country”: “us”,
“difficultyLabel”: “Hard”,
“volumeLabel”: “MoreThanOneThousand”,
“updatedAt”: “2024-06-26T06:00:15Z”
},
{
“id”: “282f9ef8a8e45742e85bb7bbb88ae8c3-us”,
“keyword”: “italian pasta recipes”,
“country”: “us”,
“difficultyLabel”: “Medium”,
“volumeLabel”: “MoreThanOneThousand”,
“updatedAt”: “2024-06-27T04:45:47Z”
},
{
“id”: “132b55eabee199cebc93211896189761-us”,
“keyword”: “italian pasta dishes”,
“country”: “us”,
“difficultyLabel”: “Medium”,
“volumeLabel”: “MoreThanOneThousand”,
“updatedAt”: “2024-06-26T08:54:18Z”
},
{
“id”: “b38c265bf59bf4c49cd0e34bf8001f0d-us”,
“keyword”: “traditional italian pasta fagioli recipe”,
“country”: “us”,
“difficultyLabel”: “Medium”,
“volumeLabel”: “MoreThanOneThousand”,
“updatedAt”: “2024-06-26T13:19:53Z”
},
{
“id”: “030ca8a2d91b7e3b174b9db34361433a-us”,
“keyword”: “italian pasta salad recipes”,
“country”: “us”,
“difficultyLabel”: “Hard”,
“volumeLabel”: “MoreThanOneThousand”,
“updatedAt”: “2024-06-22T11:01:56Z”

So I need to collect specific data from the collection inside the array, which are:

keyword / difficultyLabel / volumeLabel / updatedAt

And add them as single text, one per line, into a google spread sheet cell.

What would give me the following final structure:
italian pasta salad / Hard / MoreThanTenThousand / 2024-06-26T15:10:52Z
italian pasta / Medium / MoreThanOneThousand / 2024-06-26T17:03:58Z
italian pasta salad recipe / Hard / MoreThanOneThousand / 2024-06-26T06:00:15Z

What is the best way to do that?

Thank you very much!!

Steps taken so far

Parse a json, get the information from the json text and add it a google spreadsheet

Screenshots: scenario setup, module configuration, errors

Can you please send over a full copy of your JSON you missed some of the structure.

Welcome to the Make community!

Every result (item/record) from a search or iterator 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:

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

All you need to do is put an Iterator after the parse JSON. Iterate over your array variable value.

This will then allow you to separate into bundles and can easily map those to add a row or update a row on google sheets. @rodrigominda

Hello all, thanks for your help with this question.

I did what MrMake said, I added the interator, and it seems to be adding all the values to the spreadsheet, but it is adding it on the same cell. Every time the interator runs it overwrites the cell. Image below

Is it possible to store all the values from the interator on a variable and then add everything as a single text (all texts) to the same spreadsheet cell?

thanks again!!

You’ll need to use an Aggregator, specifically a Text Aggregator module, to combine the 20 bundles into a single text variable, as mentioned above.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

Hi Samliew,

thanks for your reply! I did that, but it is only returning me a single output. What I’m missing?

this is my scenario:

Thanks again!!

Looks like you’ll need to put an array Iterator module before the Text Aggregator, and insert the 2.allIdeas.results array into it.

Currently you aren’t iterating the array.

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

1 Like

Hi samliew, you are a life saver!!
Thank you very much for all your help with that.
It worked wonderfully!! :slight_smile:

It is excatly what I needed!

Thank you very much!!! :slight_smile:

All the best

No problem, glad I could help!

1. If anyone has a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

  • others can save time when catching up with the latest activity here, and
  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

4. Do join the unofficial Make Discord server for live chat and video assistance

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

Articles & Videos

Partner & Custom Apps

samliewrequest private consultation

Join the Make Fans Discord server to chat with other makers!

Hi samliew, you really helped a lot!! :slight_smile:
Many thanks!! :slight_smile:

I read the the guideline you sent and already checked the right answer!
Thank you very much.

Have a great week!!!
All the best.