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.
||Array||Required. A given array to add an element to at the beginning.|
||*||Required. The element added to the beginning of an array.|
||Array||The shifted array with the new element at the beginning.|
In this IAP example:
The Reference value for the
["oldDevice"], and the
elementNvariable is statically set as
The incoming variables are displayed under the Incoming tab in Task History, which is accessed from Job Manager.
unshiftedArrayvariable that returns has shifted
["newDevice"]to the beginning before
["oldDevice"], which changes the order of the array.