DocsWorkflowsComponentsAppapp:records:query

app:records:query

Queries records from a schema table using filters, sorting and pagination

Options

NameTypeDescription
org_idstringThe organization ID that scopes the operation
schemastringThe name of the schema (database) to query records from
tablestringThe name of the table to query records from
pageintThe page number to retrieve (1-based)
queryQueryThe filter, sort, limit and offset parameters for the query
  ↳ filters[]FilterAre AND-combined predicates that records must satisfy
    ↳ fieldstringIs the name of the field to compare. Must exist on the target table.
    ↳ opFilterOpIs the comparison operator.
    ↳ valueanyIs the operand. For OpIn and OpNotIn it must be a slice. Ignored for OpIsNull and OpIsNotNull.
  ↳ sort[]SortFieldIs the ordered list of sort criteria. Earlier entries take precedence
    ↳ fieldstringIs the name of the field to sort by.
    ↳ directionSortDirectionIs the sort order (ascending or descending).
  ↳ limitintCaps the number of returned records. 0 means no limit
  ↳ offsetintSkips the first N matching records. Intended for pagination
  ↳ include_deletedboolIncludeDeleted, when true, includes soft-deleted records in the result Defaults to false so deleted records are filtered out
  ↳ searchstringIs a full-text search query

Outputs

NameTypeDescription
limitintThe maximum number of records per page applied to the query
pageintThe current page number returned
totalintThe total number of matching records across all pages
items[]RecordThe records on the current page

Example

name: Query published articles
actions:
  - name: articles
    component: app:records:query
    vars:
      org_id: "{{ var.org_id }}"
      schema: content
      table: articles
      query:
        status: published

outputs:
  articles: "{{ articles.items }}"
  total: "{{ articles.total }}"