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:
| Setting | Purpose |
|---|---|
| Filter | WHERE conditions |
| Sort | Order; sort fields must match Distinct fields when both are used. Vector fields enable semantic sort |
| Distinct | Dedupe by field(s) |
| Limit | 1 = single record; >1 = array |
⚠️
Comparing any value to null in a filter is always true. Use conditional data to substitute a value that makes the condition false when input is empty (e.g. id = -1 when ID is null).
Databinding
Bind query results to component content, component actions, or page actions.
| Source | Reference path |
|---|---|
| Page data source | Page data → data source |
| List data source | Component data → list → list item / index |
Example: Blog CRUD
Uses database, parameters, and database operations.
Data model
posttable:title,content,author,published_status,show_at,like_count— one-to-many from account viaauthornotificationtable:sender_account,receiver_account,message— sender/receiver relations to account
.png)
Create — publish article
- Writing page with title input and rich text editor
- Insert action on Add button
- Map inputs to
postfields;author= logged-in accountid
.png)
Read — article list
- List on home → data source
post - Filter
published_status = true; sortshow_atdescending - Bind title, cover to list item fields
.png)
Read — detail page
- Detail page with path parameter
blog_id - List item Navigate action sets
blog_idfrom itemid - Page data source filter:
id = blog_id, limit1 - Bind fields to display content
.png)
Update — like + notification
- Update post on Like — filter
id = list item.id;like_count = like_count + 1 - On success, Insert notification — sender = logged-in account, receiver =
list item.author, dynamicmessage
.png)
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