> For the complete documentation index, see [llms.txt](https://docs.documint.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.documint.me/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/usdjoin.md).

# $join

#### Signature

`{{$join array [path] [separator] [final] }}`

#### Arguments

<table><thead><tr><th width="150">Name</th><th width="272.5333333333333">Description</th><th width="150">Type<select multiple><option value="b0403385da1b4af9a8a894cb7cfa1e88" label="String" color="blue"></option><option value="6a3ca9c830be4cd5a2bcf10d17c44f82" label="Number" color="blue"></option><option value="011b91dfe58a400894b04549ec4f9e02" label="Boolean" color="blue"></option><option value="3c1342f6b38a46e39064bd88015df50d" label="Any" color="blue"></option><option value="fe749c5299b341f8a6aaa533ce045b4d" label="String Array" color="blue"></option><option value="525618894ebe442ca9721339fc729e56" label="Number Array" color="blue"></option><option value="d5f34c3a9e6d4a0da0490ee7be091a26" label="Object Array" color="blue"></option><option value="72a2ef6ca94a4272bc70b7acaceec18e" label="" color="blue"></option></select></th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>array</td><td>Accepts either an array of data or a relative <a href="/pages/ABxtwZEqy7Nm8F6f8MWG#path">path</a>, as a String, to an array.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String, </span><span data-option="fe749c5299b341f8a6aaa533ce045b4d">String Array, </span><span data-option="525618894ebe442ca9721339fc729e56">Number Array, </span><span data-option="d5f34c3a9e6d4a0da0490ee7be091a26">Object Array</span></td><td>true</td></tr><tr><td>path</td><td><p>If the array is a collection (an array of objects) then use this <a href="/pages/ABxtwZEqy7Nm8F6f8MWG#path">path</a> to specify which property in the object should be concatenated.</p><p><mark style="color:blue;"><strong>Default value</strong></mark>: ", "</p></td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr><tr><td>separator</td><td>String that separates each item in the array.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr><tr><td>final</td><td>The string that's used to separate the last two items.</td><td><span data-option="b0403385da1b4af9a8a894cb7cfa1e88">String</span></td><td>false</td></tr></tbody></table>

#### Example #1 - Array of strings

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$join categories ", " " & "}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "categories": ["Disguise", "Explosive", "Transportation"]
}
```

{% endtab %}

{% tab title="Result" %}
Disguise, Maintenance & Transportation
{% endtab %}
{% endtabs %}

#### Example #2- Collection (array of objects)

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$join items "name" ", " " & "}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "items": [
    { "name": "Glue V1", "price": 9.99 },
    { "name": "Artificial Rock", "price": 26.99 },
    { "name": "Bat-Man's Outfit", "price": 159.99 }
  ]
}
```

{% endtab %}

{% tab title="Result" %}
Glue V1, Artificial Rock & Bat-Man's Outfit
{% endtab %}
{% endtabs %}

#### Example #3 - Path to array

{% tabs %}
{% tab title="Template" %}

```handlebars
{{$join "company.employees" "name" ", " " & "}}
```

{% endtab %}

{% tab title="Data" %}

```json
{
  "company": {
    "name": "Acme Co.",
    "employees": [
      {
        "name": "Bernadine Burton",
        "role": "Decoy"
      },
      {
        "name": "Good Battle",
        "role": "Field Agent"
      },
      {
        "name": "Dennis Miles",
        "role": "Field Agent"
      }
    ]
  }
}
```

{% endtab %}

{% tab title="Result" %}
Bernadine Burton, Good Battle & Dennis Miles
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.documint.me/templates/working-with-dynamic-data/functions-and-operators/functions/list-arrays/usdjoin.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
