---
schema_version: "1"
id: 3264266e4a5e3452c441fd6099623c40545c71a8cd55505d3e4bf1086d7b104b
title: Concatenate List Items
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_concatenate_list_items.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_concatenate_list_items.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 66f7de7d448af889ce10798c7d285ed7d605a89abe158efa0c855190f51eb41c
description: This Integration Procedure example concatenates values from an array into a single comma-separated string by using a Set Values Action inside a Loop Block, then trimming and returning the output.
products:
  - Omnistudio
release: "264"
---
# Concatenate List Items

This Integration Procedure example concatenates values from an array into a single comma-separated string by using a Set Values Action inside a Loop Block, then trimming and returning the output.

For this example, use this simple JSON input:

```json
{
   "Items": [
           {
               "Item": "First"
           },
           {
               "Item": "Second"
           },
           {
               "Item": "Third"
           }
       ]
}
      
```

You create a Loop Block, with `Items` as the Loop List. Inside the Loop Block, you use a Set Values Action to add the value of each `Item` to a string called `ConcatString`. Finally, you trim the extra characters from `ConcatString` by using a Set Values action, then use a Response Action to pass `ConcatString` to the output.

Use the following steps to configure the Integration Procedure.

1. Create a Loop Block with `Items` in the Loop List field.
2. Inside the Loop Block, create a Set Values Action to concatenate the current item to `ConcatString`.
3. In the Set Values Action's Element Value Map, add one element, `Concat`, that gets the current value of `ConcatString` and adds Item.
    
    - Element Name: `Concat`
    - Value: `=%ConcatString% + ", " + %Items:Item%`
4. Use the Response JSON to put Concat into ConcatString for the next round.
    
    - Response JSON Path: `Concat`
    - Response JSON Node: `ConcatString`
5. After the Loop Block, the strings are concatenated, but there’s an extra comma and space at the beginning of `ConcatString` from the first execution of the loop. You can trim the output by adding a Set Values component after the Loop Block.
    
    - Element Name: `TrimOutput`
    - Element Value Map: `ConcatString`
        - Element Name: `TrimmedString`
        - Value: `=SUBSTRING(ConcatString, 2)`
6. Finally, send the resulting TrimmedString from TrimOutput to the output by using a Response Action.
    
    - Send JSON Path: `TrimOutput:TrimmedString`
    - Send JSON Node: `Output`

The output looks like this.

```json
{
 "Output": "First, Second, Third"
}
```