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

# arrayPop

> Use the popFromArray task to remove the last element from a job array variable and return the removed item.

The `arrayPop` task removes the last item from a non-empty job array variable and returns the removed item with a success finish state. If the job array variable has no elements, the task returns a failure finish state.

## Properties

| Incoming                       | Description                 |
| :----------------------------- | :-------------------------- |
| Select Job Variable (required) | The job variable to modify. |

| Outgoing      | Description       |
| :------------ | :---------------- |
| `popped_item` | The removed item. |

## Example

Assume a job variable named `fruits` with value `["apple","banana","orange"]` and you want to remove the last element.

#### Select the job variable

In the pop task's properties dialog, select `fruits` from the **Select Job Variables** dropdown.

#### Apply the change

Click **UPDATE**.

The task changes `fruits` to `["apple","banana"]` and returns `"orange"` in the outgoing variable `popped_item`.

![](/_fern-img/46a1a725523dd8923034a22da074435cf9e131d6dc92dee5776f9234e6d99fc9.webp)