Skip to Content
DocumentationDataGuidesQuery and Bind Data

Query and Bind Data

After configuring the database or API, fetch data through data sources and bind it to pages and components.

  • List components configure data sources directly
  • Pages and other components declare a page-level data source first

Workflow

Configure a data source

On pages or list components (List, Custom Selector, Data Selector):

  • List components: Data tab in the right sidebar
  • Pages: declare a data source on the page Data tab

For database sources:

SettingPurpose
FilterWHERE conditions
SortOrder; sort fields must match Distinct fields when both are used. Vector fields enable semantic sort
DistinctDedupe by field(s)
Limit1 = single record; >1 = array
⚠️

When a value bound to a filter is null, the filter may not narrow the query as expected. Do not rely on an empty value to filter out records automatically.

If the query should return no records when the input is empty, use conditional data to replace null with a value that cannot exist. For example, replace an empty positive integer ID with -1.

Bind data

Bind query results to component content, component actions, or page actions.

SourceReference path
Page data sourcePage data → data source
List data sourceComponent data → list → list item / index

Example: blog CRUD

Uses database, parameters, and database operations.

Data model

  • post table: title, content, author, published_status, show_at, like_count — one-to-many from account via author
  • notification table: sender_account, receiver_account, message — sender/receiver relations to account

Data model

Create — publish article

  1. Writing page with title input and rich text editor
  2. Insert action on Add button
  3. Map inputs to post fields; author = logged-in account id

Insert action

Read — article list

  1. List on home → data source post
  2. Filter published_status = true; sort show_at descending
  3. Bind title, cover to list item fields

List source

Read — detail page

  1. Detail page with path parameter blog_id
  2. List item Navigate action sets blog_id from item id
  3. Page data source filter: id = blog_id, limit 1
  4. Bind fields to display content

Detail filter

Update — unpublish an article

  1. Add an Unpublish button on the detail page and configure an update action for post
  2. Filter by id = page data source.id; verify the filter carefully because a broad filter can update multiple records
  3. Set published_status to false; on success, navigate back to the article list or refresh the data source

Notes

  • Subscription: real-time push when data changes — chat, live dashboards
  • Update/Delete: verify filters precisely — broad filters can affect entire tables
  • Arrays: use formulas such as GET_ITEM — see Formulas
  • Conditional values: Configure Conditional Data
Last updated on