Skip to main content

Remove from list

Sophie avatar
Written by Sophie
Updated over a week ago

Definition and Usage

This command removes a specified item from a list. It allows you to delete an item either by specifying its index position or by matching its value.


Parameter Values

Input parameters

Parameter

Description

Possible Values

Required

Options / Notes

From list

Select a list variable to remove item from

Yes

Remove item by

Specify whether to remove the item at a specified index or the item with a specific value

Index, Value

Yes

Item index

Indices start from 0, where 0 represents the first item, 1 represents the second item, and so on

Yes (if "Index" is selected)

Negative indices are also supported, where -1 represents the last item, -2 represents the second-to-last item, and so on

With value

Specify a value. Item with this value will be deleted

Yes (if "Value" is selected)

Error handling

Parameter Name

Description

Throw error & stop

When an error occurs, the action will trigger an error and stop the execution of the entire app.

Retry command

If an error occurs, the action will retry the command in an attempt to resolve the issue and continue the process.

Ignore error & continue

When an error occurs, the action will be ignored, and the workflow will continue without interruption.

Variables produced

This action doesn't produce any variables.


Using Variables in Conditions

You can use variables in the "From list", "Item index", and "With value" fields by clicking on the variable icon {x} and selecting a previously defined variable. For the "From list" parameter, make sure to select a variable that contains a list. For "Item index", use a numeric variable, and for "With value", the variable type should match the type of items in your list.


Notes

  • The list must exist and contain at least one item before using this command; otherwise, an error will occur.

  • When removing by index, ensure the index is within the valid range for the list; otherwise, the command will fail.

  • When removing by value, if multiple items in the list match the specified value, only the first occurrence will be removed.

  • If you need to remove all occurrences of a value, you would need to use this command in a loop.

Did this answer your question?