Task References

On this page:



The unshift task is used to add an element to the beginning of an array.

Potential Use Case

Suppose you have an older device that is listed for updating in a dataset and you want to insert a new device that will get the update first. You could run the unshift task to list the new device at the beginning of the dataset.


Input and output parameters are shown below.

Incoming Type Description
arr Array Required. A given array to add an element to at the beginning.
elementN * Required. The element added to the beginning of an array.

Outgoing Type Description
unshiftedArray Array The shifted array with the new element at the beginning.


In this IAP example:

  • The Reference value for the arr variable is ["oldDevice"], and the elementN variable is statically set as ["newDevice"].


  • The incoming variables are displayed under the Incoming tab in Task History, which is accessed from Job Manager.


  • The unshiftedArray variable that returns has shifted ["newDevice"] to the beginning before ["oldDevice"], which changes the order of the array.