# Create comma separated string from array

**URL:** <https://community.make.com/t/create-comma-separated-string-from-array/31555>\
**Category:** Questions\
**Tags:** arrays\
**Created:** [March 24, 2024, 10:40pm UTC](https://community.make.com/t/create-comma-separated-string-from-array/31555 "2024-03-24T22:40:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_V](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/kevin_v/32/64899_2.png) [@Kevin\_V](https://community.make.com/u/Kevin_V)\
**Post date:** [March 24, 2024, 10:40pm UTC](https://community.make.com/t/create-comma-separated-string-from-array/31555/1 "2024-03-24T22:40:27Z")

</div>

Hi all,

I have a HTTP module that returns an array of collections with values including a name, description and number.  
Rough response is:  
items: [  
{  
name: name 1,  
description: description1,  
number: number 1  
},  
{  
name: name 2,  
description: description2,  
number: number 2  
},  
{  
name: name 3,  
description: description3,  
number: number 3  
},  
]

I want to extract those values for each collection and create a comma separated string in the format of name1 | description1 | number1, name2 | description2 | number 2, etc.

I’m trying to achieve this through a Text Aggregator, however, the closest I can get to the desired string is the format of name1,name2,name3 | description1,description2,description3 | number1, number2, number3.

Here is my Text Aggregator setup:

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/d/b/dbbda8546d0d48a973406469799a0b043a647fe4.png)

How can I change this to get the desired structure?

Thanks

---

<div class="post-metadata">

**Author:** ![rthidden](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/rthidden/32/16248_2.png) [@rthidden](https://community.make.com/u/rthidden)\
**Post date:** [March 24, 2024, 11:33pm UTC](https://community.make.com/t/create-comma-separated-string-from-array/31555/2 "2024-03-24T23:33:09Z")

</div>

If you can share the blueprint, I could take a look and offer more help.

First thought, I would try using:

**1.** An Iterator module to process each item in the array; **then**  
**2.** A Text Parser to concatenate each iteration (for each item processed by the Iterator) of `name` , `description` , and `number` into the desired format `name | description | number`  
**A**. In the module, create a string in the format `${name} | ${description} | ${number}` by referencing the fields from each iterated item.  
**3.**  **Next** , an Aggregator module to collect the formatted strings back into an array; **then**  
**4.** Another Text Parser to join the array of formatted strings into a single comma-separated string using a join command

Hope this helps.

---

<div class="post-metadata">

**Author:** ![samliew](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/samliew/32/13327_2.png) [@samliew](https://community.make.com/u/samliew)\
**Post date:** [March 25, 2024, 1:02am UTC](https://community.make.com/t/create-comma-separated-string-from-array/31555/3 "2024-03-25T01:02:57Z")

</div>

Welcome to the Make community!

Yes, that is possible. You’ll need a minimum of two modules:

 ![Screenshot_2024-03-25_090317](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/5/1/51f8eb7e88f1dc8b757690edb711c812e3c9daaa.png)

Give it a go and let us know if you have any issues!

You can copy and paste this module export into your scenario. This will paste the modules shown in my screenshots above.

1. Copy the code below by clicking the copy button when you mouseover the **top-right** of the code block  
 ![Screenshot_2024-01-17_200117](https://europe1.discourse-cdn.com/flex013/uploads/make/original/3X/2/b/2b1b692880388420db5045bf51ef344e6698a816.png)

2. Enter your scenario editor. Press ESC to close any dialogs. Press CTRLV to paste in the canvas.

3. Click on each imported module and save it. You may need to remap some variables.

### Modules JSON Export

```json
{
    "subflows": [
        {
            "flow": [
                {
                    "id": 37,
                    "module": "builtin:BasicFeeder",
                    "version": 1,
                    "parameters": {},
                    "mapper": {
                        "array": "{{36.items}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 589,
                            "y": -1653
                        },
                        "restore": {
                            "expect": {
                                "array": {
                                    "mode": "edit"
                                }
                            }
                        },
                        "expect": [
                            {
                                "name": "array",
                                "type": "array",
                                "label": "Array",
                                "mode": "edit",
                                "spec": []
                            }
                        ]
                    }
                },
                {
                    "id": 38,
                    "module": "util:TextAggregator",
                    "version": 1,
                    "parameters": {
                        "rowSeparator": "other",
                        "otherRowSeparator": ", ",
                        "feeder": 37
                    },
                    "mapper": {
                        "value": "{{37.name}} | {{37.description}} | {{37.number}}"
                    },
                    "metadata": {
                        "designer": {
                            "x": 834,
                            "y": -1654,
                            "messages": [
                                {
                                    "category": "last",
                                    "severity": "warning",
                                    "message": "A transformer should not be the last module in the route."
                                }
                            ]
                        },
                        "restore": {
                            "parameters": {
                                "rowSeparator": {
                                    "label": "Other"
                                }
                            },
                            "extra": {
                                "feeder": {
                                    "label": "Iterator [37]"
                                }
                            }
                        },
                        "parameters": [
                            {
                                "name": "rowSeparator",
                                "type": "select",
                                "label": "Row separator",
                                "validate": {
                                    "enum": [
                                        "\n",
                                        "\t",
                                        "other"
                                    ]
                                }
                            },
                            {
                                "name": "otherRowSeparator",
                                "type": "text",
                                "label": "Separator"
                            }
                        ],
                        "expect": [
                            {
                                "name": "value",
                                "type": "text",
                                "label": "Text"
                            }
                        ],
                        "advanced": true
                    },
                    "flags": {
                        "stopIfEmpty": true
                    }
                }
            ]
        }
    ],
    "metadata": {
        "version": 1
    }
}

```

---

<div class="post-metadata">

**Author:** ![Kevin\_V](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/kevin_v/32/64899_2.png) [@Kevin\_V](https://community.make.com/u/Kevin_V)\
**Post date:** [March 25, 2024, 3:56am UTC](https://community.make.com/t/create-comma-separated-string-from-array/31555/4 "2024-03-25T03:56:18Z")

</div>

Awesome, thanks @rthidden and @samliew - Sam’s option worked a treat. So simple, yet to effective. Not sure how I didn’t land on that one - spent way too long on that one.

---

<div class="post-metadata">

**Author:** ![Make\_Bot](https://dub1.discourse-cdn.com/flex013/user_avatar/community.make.com/make_bot/32/14661_2.png) [@Make\_Bot](https://community.make.com/u/Make_Bot)\
**Post date:** [April 8, 2024, 3:00am UTC](https://community.make.com/t/create-comma-separated-string-from-array/31555/5 "2024-04-08T03:00:18Z")

</div>

This topic was automatically closed because it's resolved or inactive. Please, start a new topic.


