List Operations
List Trimmer
This document explains the List Trimmer node, which helps reduce or extract portions of lists.
Node Inputs
Required Fields
- List: List of items to trim
Optional Fields
- Specify Section: Enable to extract specific range
- Start Index: Enter the starting index of the section you want to keep (inclusive). The first item of the list is index 0.
- End Index: Enter the ending index of the section you want to keep (exclusive).
- # of Items to Keep: When not specifying section
Node Output
- Trimmed List: Resulting shortened list
Node Functionality
The List Trimmer node:
- Shortens lists
- Extracts sections
- Uses zero-based indexing
- Preserves item order
- Handles varying sizes
When to Use
Use this node when you need to:
-
Limit Results:
- Keep top N items
- Reduce API responses
- Control output size
-
Extract Sections:
- Get specific ranges
- Split data chunks
- Sample large lists
-
Data Processing:
- Remove unwanted items
- Focus on key sections
- Prepare for batch ops
Common Use Cases
- Keep First Items:
- Extract Section:
- Limit Results:
Important Considerations
- Indices start at 0
- End index is exclusive
- Maintains item order
- Works in loop mode
In summary, the List Trimmer node helps manage list size and extract specific portions of data in your Gumloop workflows.