List Take
Runs on: Shared — pure logic, runs on the Community backend or inside a chatbox overlay.
The List Take node keeps the first or last Count items of a list and outputs the trimmed copy. The original list passed in is never modified.
Asking for more items than the list holds returns the whole list — it never errors on a short list.
Inputs
| Name | Type | Description |
|---|---|---|
list | list | The list to trim. |
count | number | How many items to keep. Defaults to 5. |
Outputs
| Name | Type | Description |
|---|---|---|
result | list | The trimmed copy of the list, same item type as the input. |
Configuration
- Keep:
FirstorLast— which end of the list to keep items from.
Example
Chain List Sort (by score, High → Low) into List Take with Keep set to First and Count set to 5 to build a top-5 leaderboard for a !top chat command. Set Keep to Last on an unsorted list of recent joiners to get "the last 5 people to join."