Filter DataTable
Filter DataTable
Section titled “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.
How it works
Section titled “How it works”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"andPendingare the same). - Logic:
orrequires any condition to match; any other value (defaultand) 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 separatecolumn/operator/value/logicfields keep working.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
table | DataTable | — | The DataTable to filter. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
conditions | object | — | 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. |
Available operators
Section titled “Available operators”| Operator | Meaning |
|---|---|
equals / not-equals | Equal / not equal. If both the cell and the value are numbers, compares them as numbers (5 = 5.0); otherwise as case-insensitive text. |
contains | Contains the text (case-insensitive). |
starts-with / ends-with | Starts / ends with (case-insensitive). |
greater-than / less-than | Greater / less than. Numeric only: both the cell and the value must be numbers. |
greater-or-equal / less-or-equal | Greater-or-equal / less-or-equal. Numeric only. |
is-empty / is-not-empty | Empty 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.
Output
Section titled “Output”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.
Common errors
Section titled “Common errors”| Message | Cause 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). |
Example
Section titled “Example”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)Related activities
Section titled “Related activities”- Find Data Row — get only the first matching row.
- Sort DataTable — sort the filtered result.
- Aggregate Column — sum/count over the filtered rows.
- Group By — summarize by categories.