> 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.

# push

> Use the push (array) task to add an element to the end of an array.

The `push` task adds an element to the end of an array. It dynamically appends the array upon which it is invoked and returns the new array.

## Potential use case

For an upcoming network fiber rollout, you need to sort through multiple contact records to collect email addresses of customers in a specific area code so you can notify them of enhanced service availability. As these customers are found in the database, use the `push` task to add their email addresses to an array that a downstream email task can then loop through for sending notifications.

## Properties

| Incoming   | Type  | Description                                               |
| :--------- | :---- | :-------------------------------------------------------- |
| `arr`      | Array | Required. The target array to receive the pushed element. |
| `elementN` | Any   | Required. The element to push.                            |

| Outgoing      | Type  | Description                                 |
| :------------ | :---- | :------------------------------------------ |
| `pushedArray` | Array | The array with the pushed element appended. |

## Example 1

In the example below, the reference task selected for each incoming variable is `job`.

![](/_fern-img/10699f4b8dfa223b33c8e293460d2f5571c2c650d234cd2d882cb9a81a30c56f.webp)

The reference variable for each incoming variable is `arr` and `elementN`, respectively. You can optionally toggle the **Run Window** slider to set the task to run on a schedule.

The array variables are set prior to running the workflow.

![](/_fern-img/c59f52775608367bbdca859c4cebef2354f9300fa0a9eb8c719b2f82b805229f.webp)

If the array is empty, an error is returned in the output.

![](/_fern-img/59bfcdeb845420416cfbc190c61cc75bada5bbb85f668c9d032bd9032c2e8aeb.webp)

After running the workflow, the variable names and incoming variables appear under the **Incoming** tab in **Task History** (accessed from Jobs in Operations Manager).

![](/_fern-img/c5fd454c69eb5cadeb2df402b98acf94b55fcc903a6704cb98a8b7bdd5831dd9.webp)

The **Outgoing** tab shows the result. Notice that **"Device 3"** was added to the end of the array.

![](/_fern-img/3fd8334409501e025680038e9b2af142f73f02f9edad20410b784250c390df6b.webp)

## Example 2

In this example, a new array is created within the workflow and a single value is pushed into it.

* The `arr` value is statically set as `[]`.
* The `elementN` value is statically set as the string `"Lemon"`.
* The outgoing `pushedArray` variable contains one item: `["Lemon"]`.

![](/_fern-img/4caeee539d6fd078319841218be1e429d4a70330907132db5cb1e0744c6570b0.webp)

## Example 3

In this example, a new array is created with a space value already in it, then the `elementN` value is pushed immediately into it.

* The `arr` value is statically set as `[" "]`.
* The `elementN` value is statically set as the string `"Lemon"`.
* The outgoing `pushedArray` variable contains two items: `[" ","Lemon"]`.

![](/_fern-img/97c2780573f2eba7e16e88b4301e77a789f663c3b62b9385e07561bb59814770.webp)