Skip to main content

Slice List

Uncontrolled node

Overview​

Extract a range of items without changing the source list.

Take a portion of a list, starting at start and stopping before end. The original 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 slice.
startNumberZero-based starting index, included in the result. Defaults to 0. Negative values count back from the end.
endNumberStopping index, excluded from the result. Unset, empty or invalid values use the list length. Negative values count back from the end.

Outputs​

OutputTypeDescription
outputDataThe selected items as a list. An empty or non-list input currently returns empty text (""), not an empty list.

Choosing a range​

Use whole-number indices. Fractional indices are rounded down. Ranges extending beyond the list are limited to the available items. A valid non-empty input with an empty selected range returns [].

Examples​

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

StartEndOutput
02["a", "b"]
2Unset["c", "d"]
-2Unset["c", "d"]
1-1["b", "c"]
31[]

If the source can be empty, check the result before passing it to a node that requires a list.