core.table.lookup
Get a single row from a table corresponding to the given column and value.
Inputs
string
required
The column to lookup the value in.
string
required
The table to lookup the value in.
any
required
The value to lookup.
Examples
Look up rowscore.table.is_in
Check if a value exists in a table column.
Inputs
string
required
The column to check in.
string
required
The table to check.
any
required
The value to check for.
Examples
Look up rowscore.table.lookup_many
Get multiple rows from a table corresponding to the given column and values.
Inputs
string
required
The column to lookup the value in.
string
required
The table to lookup the value in.
any
required
The value to lookup.
integer
The maximum number of rows to return.Default:
100.Examples
Look up rowscore.table.search_rows
Search for rows in a table with optional filtering.
Inputs
string
required
The table to search in.
string | null
Cursor for pagination.Default:
null.string | null
Filter rows created before this time.Default:
null.integer
The maximum number of rows to return.Default:
100.boolean
If true, return cursor pagination metadata along with items.Default:
false.boolean
Reverse pagination direction.Default:
false.string | null
Text to search for across all text and JSONB columns.Default:
null.string | null
Filter rows created after this time.Default:
null.string | null
Filter rows updated after this time.Default:
null.string | null
Filter rows updated before this time.Default:
null.Examples
Search table rowscore.table.aggregate_rows
Filter, group, and summarize table rows. Returns groups and a truncated flag indicating whether more groups exist than the requested limit.
The example groups alerts by source and hour, then calculates the
alert count, total bytes, and median duration for each group.
Before running it, create an alerts table with these columns:
source: TEXT.disposition: TEXT.bytes_out: INTEGER.duration_ms: NUMERIC.
ACTIONS.bytes_by_source_hourly.result.groups to read the results.
If ACTIONS.bytes_by_source_hourly.result.truncated is true,
the result reached the group limit and omitted some groups.
Inputs
array[string | object]
required
Choose how to split rows into groups. Use up to 3 fields, or
[] for one total across all matching rows.Supply a field name such as source, or an object with field and optional bucket, timezone, and alias. For example: [‘source’, {‘field’: ‘created_at’, ‘bucket’: ‘hour’}]. An alias names the field in the result; it defaults to the field name. All output names must be unique and at most 63 UTF-8 bytes.Fields you can group by:- TEXT, SELECT, INTEGER, NUMERIC, and BOOLEAN columns.
- DATE and TIMESTAMPTZ columns, including the system fields
created_atandupdated_at. These require abucket:hour,day,week, ormonth. Weeks start on Monday.
id, and internal columns are unsupported.Date and time settings:- Timestamps accept an IANA timezone name, such as
America/New_York. The default isUTC; results always contain UTC timestamps. - DATE fields return
YYYY-MM-DD. They do not accept a timezone, and even anhourbucket retains only date precision.
- Missing values share one
nullgroup. - TEXT and SELECT values use only the first 256 characters. Values with the same prefix merge into one group.
- NUMERIC values appear as exact decimal strings.
string
required
The name of the workspace table to aggregate.
array[object] | null
Choose what to calculate for each group. Omit this input to count rows. Supply up to 8 calculations; an empty list is invalid.Each calculation is an object with
function, optional field, and optional alias. For example: [{‘function’: ‘sum’, ‘field’: ‘bytes_out’, ‘alias’: ‘total_bytes’}].Available calculations:count: Count rows when you omitfield, or count non-null values when you supply it.count_distinct: Count different non-null values.sum,mean,median: Calculate the total, average, or middle value.min,max: Return the smallest or largest value.
count requires a field. Numeric columns support all functions. Text and date/time columns support count, count_distinct, min, and max. BOOLEAN and SELECT columns support only count and count_distinct.Naming and number formats:- Use
aliasto name a result, such astotal_bytes. Otherwise the name iscountorfunction_field. All output names must be unique and at most 63 UTF-8 bytes. - Counts are integers. INTEGER/NUMERIC sums, all means and medians, and NUMERIC min/max use floating-point numbers and can lose precision. NUMERIC grouping values remain exact decimal strings.
null.object | null
Choose which rows to include before grouping. Omit this input to include all rows.Write one condition as {‘field’: ‘amount’, ‘op’: ‘gte’, ‘value’: 10}. Combine conditions with {‘and’: […]}, {‘or’: […]}, or {‘not’: {…}}.Choose an operator supported by the column type:
- TEXT:
eq,ne,in,not_in,is_null,contains, andstarts_with. Onlycontainsandstarts_withignore case and match literal text;eq,ne,in, andnot_inare case-sensitive. - INTEGER and NUMERIC:
eq,ne,in,not_in,gt,gte,lt,lte, andis_null. - DATE and TIMESTAMPTZ:
eq,ne,gt,gte,lt,lte, andis_null. - SELECT:
eq,ne,in,not_in, andis_null. - BOOLEAN:
eq,ne, andis_null.
in or not_in. Omit value for is_null. Use strings for exact decimals and ISO-formatted dates or timestamps.ne and not_in exclude missing values. An empty not_in list matches all rows; an empty in list matches none.Filters allow up to 4 levels of nesting, 50 conditions, and 1000 total values. The server validates the request when the action runs.Default: null.integer | null
Set the maximum number of groups to return. Use at least 1, up to your server’s configured maximum (normally 1000). Omit this input to use the server default (normally 100).If more groups exist, the result sets
truncated to true. There is no next-page cursor.Default: null.integer | null
Only return groups with at least this many rows (minimum 1).Default:
null.string | null
Choose a group or calculation output name to sort by, including any alias you set.If omitted, results sort by the first date/time bucket, or by the first calculation when there is no date/time bucket.Default:
null.string | null
Use
asc for ascending order or desc for descending order.If omitted, the direction is asc when the action automatically sorts by a date/time bucket. Otherwise it is desc, including when you set order_by yourself. Missing values sort last; group values break ties.Default: null.