Skip to main content

List Tally

Runs on: Shared (backend or chatbox overlay).

Counts how many times each value (or field value) occurs in a list. It outputs a list of Tally entries, each with a value and a count, sorted from highest count to lowest. Ties go to whichever value appeared first in the input.

For lists of plain strings, numbers or booleans, whole values are tallied. For lists of custom or built-in objects, pick a Field to tally by, or wire the field input to choose it at runtime. Items missing the value or field are skipped, not counted as blank.

value on the output is always text, even when the source values are numbers or booleans.

Inputs​

NameTypeDescription
listlistThe list to tally.
fieldstringWire this to choose the field at runtime instead of in the node.

Outputs​

NameTypeDescription
resultArray<Tally>One { value, count } entry per distinct value, sorted by count descending.

Configuration​

  • Case Sensitive: Text comparisons only. Off on new nodes, so "Blue" and "blue" tally together and the output keeps whichever spelling appeared first.
  • Field: The field to tally in lists of objects. Whole Item tallies the whole value.

Example​

A !vote command appends each chatter's choice to a broadcaster list variable. When the poll closes, run List Tally with Field choice, then List Take (first 3) and List To Text to announce the top three.