# How to convert array values to string separated by commas

**URL:** <https://connective.celigo.com/t/how-to-convert-array-values-to-string-separated-by-commas/1132>\
**Category:** Integrator.io\
**Tags:** javascript\
**Created:** [September 9, 2021, 5:17pm UTC](https://connective.celigo.com/t/how-to-convert-array-values-to-string-separated-by-commas/1132 "2021-09-09T17:17:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrishuovinen](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/chrishuovinen/32/6776_2.png) [@chrishuovinen](https://connective.celigo.com/u/chrishuovinen)\
**Post date:** [September 9, 2021, 5:17pm UTC](https://connective.celigo.com/t/how-to-convert-array-values-to-string-separated-by-commas/1132/1 "2021-09-09T17:17:07Z")

</div>

I need some guidance on converting an array to a string listing the element values separated by commas. I attempted to use the array.toString method but it doesn't seem to work. I'd greatly appreciate any help.

Payload:  
"properties": [  
{  
"name": "Engraved Text",  
"value": "09/04/21 M&C"  
},  
{  
"name": "Fill Color",  
"value": "WHITE"  
},  
{  
"name": "Engraved Font",  
"value": "Bellefair"  
}

Desired Result:  
"Engraved Text:09/04/21 M&C,Fill Color:WHITE,Engraved Font:Bellefair"

Note - the array "properties" is a sub-array (not sure the terminology) of another array named "line\_items"

---

<div class="post-metadata">

**Author:** ![orionabrams](https://avatars.discourse-cdn.com/v4/letter/o/e5b9ba/32.png) [@orionabrams](https://connective.celigo.com/u/orionabrams)\
**Post date:** [September 13, 2021, 8:34pm UTC](https://connective.celigo.com/t/how-to-convert-array-values-to-string-separated-by-commas/1132/2 "2021-09-13T20:34:16Z")

</div>

Hi Chris,

The below handlebar should do what you need. If this is a subarray, you also need to wrap an {{#each line\_items}} around it. Note that whatever field you're mapping this to is going to get one of these for every line item, and your final result would be all of them concatenated together. It seems like this should maybe be done with a JS hook to store the value in a new field, to easily be mapped 1:1, instead of handlebar statement.

{{#each properties}}{{{name}}}:{{{value}}}{{#unless @last}},{{/unless}}{{/each}}
