Description
There are scenarios in which we want to delete a specific item from an array or delete all the items in the array before proceeding with the next activity. In this article, you will learn how to delete values from an array in Studio Pro.
Instructions
-
If you want to delete all the values from an array, then you can do as follows:
Existing array:
Specifying the value [] deletes all the values from the array.
-
If you want to delete an element from a specific index in an array, you can use the Execute JS code activity to do it.
Existing array:
If you want to delete the value ‘Orange’ from the above array, do as follows:
Notice that this command is made up of 3 elements: the array name, the JS method splice, and the coordinates of the item to be removed, where splice() is used to delete an element from a specific index. After running the workflow, you have the modified array: