List Operations
List Trimmer Node
Trim a list to a specified size
This node trims a list to just contain sections you want. You can enter the number of items to keep or specify the section of the list you want to keep.
For example, for the list [a, b, c], if we were to keep 2 items, the output would be [a, b].
Node Inputs
- Type: The type of list you want to create.
- Type:
Dropdown
- Type:
- List: The list you want to trim.
- Type:
List<T>
(based on the type of list you choose)
- Type:
Node Parameters
- Specify Section: When this is turned on you need to specify both the start index and end index of the section you want to keep.
- Number of Items to Keep: When the parameter Specify Section is switched off you need to specify the number of items you want to keep.
Node Outputs
- Output: The trimmed list
- Type:
List<T>
- Example usage:
{{list_trimmer_0.output}}
- Type:
Considerations
- If you give a value in Number of Items to Keep that is greater than the length of the given list then the whole list will be returned.
- If the Specify Section parameter is turned on you need to specify the indexes. The start of the list is denoted by index 0.