Skip to main content

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​

NameTypeDescription
listlistThe list to search.
valueanyThe value to compare against. When Field is set, it is compared to that field on each object.
fieldstringWire this to choose the field at runtime instead of in the node.

Outputs​

NameTypeDescription
itemanyThe first matching item, or null if none matched.
passanyThe matching item. Fires only when a match was found.
failanynull. Fires only when no match was found.
indexnumberThe 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 Item compares entire objects, where only Equals and Not Equals make 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.