Zum Hauptinhalt springen

Tables

Functions for creating and editing workspace tables and their rows. A table's row shape is described by a root JSON Schema (an object with properties). Rows are addressed by a record id (__record_id).

Schema first: Call table-read for a tableId before table-read-rows, row writes, table-value-counts, or dashboard widgets that name columns — use only property keys from schema.properties (and saved views from the same result).

Typical reading flow: table-readtable-read-rows (paginated slice) or table-value-counts (distribution / ranking over all matching rows) → table-read-row for one row. Typical writing flow: table-row-create / table-row-updatetable-read-row to verify. Saved views: table-readtable-view-createtable-read to confirm.


table-create

Create one workspace table. Only name is required. If schema is omitted, an empty object-shaped schema is applied — define columns later with table-update-interface.

Input

FieldTypeRequiredDescription
namestringYesDisplay name for the table.
schemaobjectNoFull root JSON Schema for the row shape.
descriptionstringNoTable description.
interfaceNamestringNoInterface/model name shown in the table editor.

Output

FieldTypeDescription
tableIdstringId of the new table (t_…).
tableobject\{ id, name \}.

table-read

Read one table's definition: JSON schema, interface name, description, metadata, active columns, saved filters, available views (id, name, filter), and row count. Does not return row payloads — use table-read-rows for rows.

Input

FieldTypeRequiredDescription
tableIdstringYesTable id (t_…).

Output

FieldTypeDescription
tableobjectSchema, interfaceName, description, metadata, activeColumns, filters, views[], and row count.

table-read-rows

Read a paginated slice of rows (like reading a section of a long file). Supports keyword search, structured filter, saved viewId, and sorting. Returns rows plus pagination metadata.

Input

FieldTypeRequiredDescription
tableIdstringYesTable id (t_…).
pagenumberNo1-based page index (default 1).
pageSizenumberNoRows per page (default 10, max 100).
searchstringNoCase-insensitive keyword search across all columns.
filterobjectNoTableRecordFilter (optional).
viewIdstringNoSaved view id (from table-read); its filter is AND-merged with filter.
sortBystringNoColumn key to sort by.
sortOrderenumNoasc or desc (default asc when sortBy is set).

Output

FieldTypeDescription
tableIdstringThe table id.
rowsarrayThe page of rows.
paginationobject\{ page, pageSize, totalRows, totalPages, hasNextPage \}.

table-read-row

Read one row by record id. Use after a create/update to confirm persistence.

Input

FieldTypeRequiredDescription
tableIdstringYesTable id (t_…).
recordIdstringYesRow id (__record_id, or the recordId returned on create).

Output

FieldTypeDescription
tableIdstringThe table id.
rowobjectThe row payload.

table-row-create

Insert one row. Match the column keys from the table's JSON schema. Do not pass __record_id.

Input

FieldTypeRequiredDescription
tableIdstringYesTable id (t_…).
dataobjectYesRow fields keyed by schema property names.

Output

FieldTypeDescription
tableIdstringThe table id.
recordIdstringId of the inserted row.
rowobjectThe inserted row plus __record_id.

table-row-update

Update one row by record id with a partial data object (merged into the existing row).

Input

FieldTypeRequiredDescription
tableIdstringYesTable id (t_…).
recordIdstringYesRow id (__record_id).
dataobjectYesPartial fields to merge into the row.

Output

FieldTypeDescription
tableIdstringThe table id.
recordIdstringThe updated row id.
rowobjectThe merged row plus __record_id.

table-view-create

Create one saved row view on a table (used by the data table UI and by table-read-rows / dashboard widgets via viewId). Call table-read first for schema and existing views.

Input

FieldTypeRequiredDescription
tableIdstringYesTable id (t_…).
namestringYesView display name (unique per table).
filterobjectNoTableRecordFilter (same as table-read-rows). Omit when the view shows all rows.
visibleColumnsstring[]NoSchema property keys shown in the view. Omit or [] = all columns (same as the table UI).
editableColumnsstring[]NoSchema property keys editable in the view. Omit or [] = UI default (all visible columns).
isDefaultbooleanNoSet as default view. Default true when this is the first view on the table.

Output

FieldTypeDescription
tableIdstringThe table id.
viewIdstringNew view id (UUID).
viewNamestringView display name.
isDefaultbooleanWhether this view is the table default.
filterobject | nullRow filter stored on the view, if any.
visibleColumnsstring[]Columns shown in the view.
editableColumnsstring[]Columns editable in the view.

table-value-counts

Count rows per distinct value of one column (SQL GROUP BY), sorted by count descending. Prefer this over paging through table-read-rows when you need distributions or rankings ("which status is most common", "which seller has the most contracts"). Call table-read first so column matches a schema property name.

Supports the same optional filter and viewId as table-read-rows (merged AND). Each call is standalone.

Input

FieldTypeRequiredDescription
tableIdstringYesTable id (t_…).
columnstringYesSchema property key to group by (e.g. status, VerkaeuferNr).
filterobjectNoTableRecordFilter; omit for the whole table.
viewIdstringNoSaved view id from table-read; AND-merged with filter.
limitnumberNoMax distinct values returned (default 100, max 100).

Output

FieldTypeDescription
tableIdstringThe table id.
columnstringThe column grouped by.
groupsarray\{ label, value \}[] — distinct values with row counts, highest count first.
distinctValuesnumberNumber of groups returned (up to limit).
topGroupobject | nullThe group with the highest count, if any.
filterAppliedobject | nullEffective filter after merging view + filter.
viewIdAppliedstring | nullView id used, if any.

table-update-interface

Update a table's definition: pass at least one of schema, name, description, or interfaceName. schema must be a full root JSON Schema object (not an array of fields).

Input

FieldTypeRequiredDescription
tableIdstringYesTable id (t_…).
schemaobjectNoFull replacement JSON Schema object for rows.
namestringNoNew display name.
descriptionstringNoNew description.
interfaceNamestringNoNew interface/model label.

Output

FieldTypeDescription
tableIdstringThe table id.
namestringThe table name.
updatedAtstringUpdate timestamp.

TableRecordFilter

Row filters for table-read-rows, table-view-create, and table-value-counts. Field names must exist on the table schema (table-readschema.properties).

Shape

Single condition

{ "field": "status", "op": "eq", "value": "open" }

Combine conditions

{ "and": [
{ "field": "status", "op": "eq", "value": "open" },
{ "field": "priority", "op": "gte", "value": 3 }
]}
{ "or": [
{ "field": "status", "op": "eq", "value": "open" },
{ "field": "status", "op": "eq", "value": "in_progress" }
]}

Shorthand (one or more keys → implicit eq)

{ "status": "open" }
{ "status": "open", "assignee": "usr_abc" }

→ normalized to { "and": [ { "field": "status", "op": "eq", "value": "open" }, … ] }.

Operators (op)

opMeaning
eqEquals
neqNot equals
ltLess than
lteLess than or equal
gtGreater than
gteGreater than or equal
inValue in array (value must be an array)
existsField is present / non-null
containsString contains (value is substring)

Saved views

A viewId from table-read applies that view's stored filter AND any filter you pass on the same call. Use views for reusable slices (e.g. "Open tasks"); use inline filter for one-off questions.