> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.itential.com/itential-platform/6/studio/tasks/reference/shift/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server. # shift > Reference for the shift (array) workflow task, which removes the first element from an array and returns the shortened array. ## Task purpose The `shift (array)` task removes the first element from an array and returns the original array minus that element. The array length is shortened by one and all remaining elements move down. If the array is empty, the output returns an empty array. The `pop (array)` task has similar behavior to `shift (array)`, but removes the last element instead of the first. ## Potential use case Suppose your company is gathering "time to repair" statistics stored in an array, with the largest result first and the smallest last. Company policy requires discarding the largest and smallest values before calculating the average. You could use `shift (array)` to remove the largest value (first element), then use `pop (array)` on the result to remove the smallest value (last element). Subsequent tasks can then calculate the average from the remaining values. ## Properties | Incoming | Type | Description | | -------- | ----- | ----------------------------- | | `arr` | Array | Required. The array to shift. | | Outgoing | Type | Description | | -------------- | ----- | ------------------ | | `shiftedArray` | Array | The shifted array. | ## Examples ### Example 1 The incoming `arr` variable is set using the job variable `arr` as the data source. Optionally, you can toggle the **Run Window** slider to schedule the task. ![](/_fern-img/16f3a4e40aafda646582991833b970a7841cb2a78940c0489ea1338ed1976c72.webp) The array variables set prior to running the workflow: ![](/_fern-img/ac7c4de0ab51770a88376783bf935465a37a324b94436f3f9bb25b8299636330.webp) After the workflow executes, the incoming variables are displayed under the **Incoming** tab in Task History, accessible from Jobs in Operations Manager: ![](/_fern-img/6d03770e2b934deaad9bdd7116103bc777873192c3e7c814905e541883bafa70.webp) The **Outgoing** tab shows the result — `"Device 1"` has been removed from the beginning of the array: ![](/_fern-img/7d80c7c265fe9b88dedfa3c6942768cbb6ee5510726857d3b133d81dfd5e763f.webp) ### Example 2 In this example, the job variables and incoming `arr` variable are empty. ![](/_fern-img/646dfac60199339c6dff1ff6d8fc1d27806ea798dede6afb6ea6edadbb6f8893.webp)![](/_fern-img/e7ebc3669ac13776737727a6a6f77a76edc94d9faf2bb71dc10be1e61e0274c6.webp) The output returns an empty array. ![](/_fern-img/1fd22ddb7bdf4bddbf45afe9f30551e7802d3bfb41e3b49479df7c497bbee99e.webp) > Reference for the shift (array) workflow task, which removes the first element from an array and returns the shortened array.