Skip to content

Filter DataTable

Type: filter-datatable  ·  Package: DataTable Activities v1.0.5  ·  Output: DataTable

Filters a DataTable and returns a new table with only the rows that meet the conditions. It is the most common operation when processing data: keep the pending items, the ones above an amount, the ones for a customer. It supports several conditions combined with AND (all) or OR (any) logic.

Evaluates each row against the conditions. In the Designer, conditions are built with a visual editor: for each one you choose a column, an operator and a value, and you decide whether they are combined with AND (and) or OR (or). It returns a new table, with the same columns, containing only the rows that pass the filter; the original table does not change.

  • Column: by name (case-insensitive) or by position counting from 0 (0, 1…).
  • Value: compared exactly as you type it in the editor; it is not evaluated as an expression. Surrounding quotes are removed ("Pending" and Pending are the same).
  • Logic: or requires any condition to match; any other value (default and) requires all of them. Conditions are evaluated in order and evaluation stops as soon as the result is decided.
  • The structure the editor saves is { logic, items: [ { column, operator, value } ] }; a flat list of conditions is also accepted. Older playbooks that expressed a single condition with the separate column / operator / value / logic fields keep working.
ParameterTypeDefaultDescription
tableDataTable—The DataTable to filter.
ParameterTypeDefaultDescription
conditionsobject—Filter conditions (column · operator · value) with AND/OR logic, as { logic, items }. Although the schema marks it optional, the activity needs at least one condition to run.
OperatorMeaning
equals / not-equalsEqual / not equal. If both the cell and the value are numbers, compares them as numbers (5 = 5.0); otherwise as case-insensitive text.
containsContains the text (case-insensitive).
starts-with / ends-withStarts / ends with (case-insensitive).
greater-than / less-thanGreater / less than. Numeric only: both the cell and the value must be numbers.
greater-or-equal / less-or-equalGreater-or-equal / less-or-equal. Numeric only.
is-empty / is-not-emptyEmpty cell (or only spaces) / not empty. They ignore the value.

Numbers are read with a dot as the decimal separator (1500.50); a comma is taken as a thousands separator.

Returns a DataTable with the same columns as the original and only the matching rows, in their original order. If no row matches, it returns an empty table (0 rows, same columns), not null.

MessageCause and fix
'table' must be a DataTable.table does not evaluate to a DataTable (empty variable or another type). Check the activity that produces it.
At least one condition is required ('column'+'value' or 'conditions').There are no conditions. Add at least one in the editor.
Column '…' not found. Available columns: ….A condition’s column does not exist in the table. The message lists the real columns; fix the name.
Column index … out of range (table has … column(s)).You used a column position larger than the available ones.
Value '…' is not numeric. / Comparison value '…' is not numeric.A numeric operator (greater-than, less-than…) found a cell or a value that is not a number; this also happens with empty cells. Put an is-not-empty condition on the same column first with AND logic: since evaluation stops at the first false condition, empty rows never reach the comparison.
Unrecognized operator: '…'The operator is not one of the table above (happens when editing the playbook by hand).

Keep the pending invoices above 1,000,000:

Filter DataTable
table = invoices
conditions:
Status equals "Pending" AND
Total greater-than 1000000
→ output: important
Log message = "Matching rows: " + rowCount(important) + " of " + rowCount(invoices)