> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# toString (array)

> Reference for the toString (array) workflow task, which returns a string representing the contents of an array with elements separated by commas.

## Task purpose

The `toString (array)` task returns a string representing the contents of a given array. Each array element is separated by a comma. The task returns `null` if the array is empty.

## Potential use case

If a query into a ticketing database has populated an array with open ticket numbers, you could use this task to convert the array into a comma-separated list and include it in an email notification.

## Properties

| Incoming | Type  | Description                                |
| -------- | ----- | ------------------------------------------ |
| `arr`    | Array | Required. The array to return as a string. |

| Outgoing      | Type   | Description                           |
| ------------- | ------ | ------------------------------------- |
| `arrayString` | String | A string representation of the array. |

## Example

The input variable `arr` is shown in Task History, accessible from Jobs in Operations Manager.

![](/_fern-img/46932219672a021e30f3ea8c9403c2658a5fcbcb52d8929c79fdaf1e829c508c.webp)![](/_fern-img/8127905802a38ed4084a00629426781020de64c58d95725f2a42c9cb28f2d26e.webp)

The output shows each element separated by a comma, with no white space between values.

![](/_fern-img/438b247a827b002cc9ee6245c5482d6cb73d7f08b9e9fee81a477c05704b5a9c.webp)