> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/reference-1/functions-and-operators/functions/string/join_arrays.md).

# JOIN\_ARRAYS

Joins any number of arrays by index using a MessageFormat pattern.

## Syntax

```sql
JOIN_ARRAYS(formatString, inputs1[, inputs2, ..., inputsN])
```

## Arguments

<table><thead><tr><th>Name</th><th width="153">Type</th><th width="238">Description</th><th>Default Value</th></tr></thead><tbody><tr><td>formatString</td><td>string</td><td>The format string where {n} prints the n'th input. For example, the pattern '{0}.{0}.{1}' on the inputs 'a' and 'b' will result in the string 'a.a.b'</td><td>null</td></tr><tr><td>inputs#</td><td>any</td><td></td><td></td></tr></tbody></table>

## Returns

Returns a `string` value.

***

## Examples

<table><thead><tr><th>formatString</th><th>inputs1</th><th width="172">inputs2</th><th>inputs3</th><th>Output</th></tr></thead><tbody><tr><td>'{0} {1} is {2} years old'</td><td>array['John', 'Jane']</td><td>array['Smith', 'Johnson']</td><td>array[35, 32]</td><td>[<code>John Smith is 35 years old</code>, <code>Jane Johnson is 32 years old</code>]</td></tr><tr><td>'{0}:{1}'</td><td>array['red', 'green', 'blue', 'luminosity']</td><td>array[255, 255, 0]</td><td></td><td>[<code>red:255</code>, <code>green:255</code>, <code>blue:0</code>, <code>luminosity:</code>]</td></tr></tbody></table>

### Transformation job example

#### SQL

```sql
CREATE JOB function_operator_example
    ADD_MISSING_COLUMNS = true
AS INSERT INTO default_glue_catalog.upsolver_samples.orders_transformed_data 
 MAP_COLUMNS_BY_NAME
  SELECT formatString, inputs1[], inputs2[], inputs3[],
  JOIN_ARRAYS('{0} {1} is {2} years old', inputs1[], inputs2[], inputs3[]) AS Output
  FROM default_glue_catalog.upsolver_samples.orders_raw_data
    LET formatString = '{0} {1} is {2} years old',
        inputs1 = array['John', 'Jane'],
        inputs2 = array['Smith', 'Johnson'],
        inputs3 = array[35, 32]
    WHERE $commit_time BETWEEN run_start_time() AND run_end_time()
    LIMIT 1;
```

#### Query result

<table><thead><tr><th>formatString</th><th>inputs1[]</th><th>inputs2[]</th><th width="161">inputs3[]</th><th>Output</th></tr></thead><tbody><tr><td>'{0} {1} is {2} years old'</td><td>array['John', 'Jane']</td><td>array['Smith', 'Johnson']</td><td>array[35, 32]</td><td>[<code>John Smith is 35 years old</code>, <code>Jane Johnson is 32 years old</code>]</td></tr></tbody></table>


---

# 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://upsolver.gitbook.io/content/reference-1/functions-and-operators/functions/string/join_arrays.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.
