List Find
Runs on: Shared (backend or chatbox overlay).
Finds the first item in a list that matches a condition. It outputs the item, its position, and Pass or Fail routes so you can branch on whether anything matched. Use it to look up a viewer by username, a leaderboard entry by name or a quote by ID.
For lists of plain strings, numbers or booleans, the condition compares the value directly. For lists of custom or built-in objects, pick a Field to compare, or wire the field input to choose it at runtime.
Condition offers Equals and Not Equals always, plus Is Greater Than, Is At Least, Is Less Than and Is At Most for numbers, or Contains, Does Not Contain, Starts With and Ends With for text.
Inputs
| Name | Type | Description |
|---|---|---|
list | list | The list to search. |
value | any | The value to compare against. When Field is set, it is compared to that field on each object. |
field | string | Wire this to choose the field at runtime instead of in the node. |
Outputs
| Name | Type | Description |
|---|---|---|
item | any | The first matching item, or null if none matched. |
pass | any | The matching item. Fires only when a match was found. |
fail | any | null. Fires only when no match was found. |
index | number | The matched item's position (0-based), or -1 if none matched. |
Configuration
- Condition: The comparison to run. Defaults to
Equals. - Case Sensitive: Text comparisons only. Off on new nodes. Existing nodes stay case-sensitive until you change it.
- Field: The field to compare in lists of objects.
Whole Itemcompares entire objects, where onlyEqualsandNot Equalsmake sense.
Example
A leaderboard is a list of objects with username and score. On a channel point redemption, set Field to username, Condition to Equals and the value to the viewer's name. On pass, update their score. On fail, add them with List Add Item. To get a viewer's rank from a sorted list, use index + 1.