Remove From List

Verb: removeAt

Removes an item from a List according to the position specified in the index.

Syntax

removeAt --index(Numeric) --collection(List<Variant>)

Inputs

Script Designer Required AcceptedTypes Description
--index Index Required Number Position of the item that should be removed.
--collection List Required List<Any> List from which the item is removed.

Example

Removes the item from position 3 in the List, in this case the name "Joseph".

defVar --name namesCollection --type List --innertype String --value "[Mary,John,Joseph,Peter,Paul]"
removeAt --index 3 --collection "${namesCollection}"
logMessage --message "${namesCollection}" --type "Info"
//The result obtained in ${namesCollection} is: [Mary,John,Peter,Paul].

See Also

  • Copy List with Restrictions