Skip to main content

Splice List

Uncontrolled node

Overview​

Remove items and optionally insert one value into a copy of a list.

Create an edited copy of a list by removing items and optionally inserting one new value at the same position. The source list is not changed.

This node is evaluated when another node needs its output. It has no run or done event.

Inputs​

InputTypeDescription
listListThe list to edit. An empty list is valid.
startNumberZero-based position to begin editing. Defaults to 0; negative values count back from the end.
deleteCountNumberNumber of items to remove. Defaults to 0, which inserts without deleting.
newItemDataOptional single value to insert. Leave unconnected to delete only. A list is inserted as one nested item, not spread into separate items.

Outputs​

OutputTypeDescription
outputDataThe edited list, or { "error": "Input is not a list" } for a non-list input.
deletedListItems removed from a valid input list, in their original order. Empty when nothing is removed. Not supplied on invalid input.

Editing behaviour​

Use whole-number positions and counts; fractions are rounded down. A position beyond the end appends the new item. A negative delete count removes nothing, and a count beyond the remaining length removes only the available items.

Supplying null, false, 0 or empty text as newItem inserts that value. To avoid inserting anything, leave newItem unset.

Examples​

For list: ["a", "b", "c"]:

StartDelete countNew itemOutputDeleted
11"x"["a", "x", "c"]["b"]
10"x"["a", "x", "b", "c"][]
12Unset["a"]["b", "c"]
30["x", "y"]["a", "b", "c", ["x", "y"]][]