Bind a block to a datasource/query
bind_block_queryBind a block to an existing query or datasource to populate its query results. Auto-creates a SELECT * query from a datasource ID while preserving HTML, CSS, and name.
Instructions
Give an existing block its data binding so currentBlock.queryResults[0] is populated. Pass an existing query_id, OR a datasource_id (a SELECT * query is auto-created against it and linked). Sets the block's ui_queries while preserving its html/css/name. The bound query must have a datasource (auto-created ones do) or the portal rejects it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | No | Optional raw SQL for the auto-created query (use alias `datasource` as the table). Only with datasource_id; default is SELECT *. | |
| dry_run | No | Preview the binding without writing (with datasource_id, the SELECT * query is NOT created either). | |
| block_id | Yes | Block UUID to bind. | |
| query_id | No | Existing saved query UUID. Mutually exclusive with datasource_id. | |
| page_size | No | Rows fetched into queryResults. Omit for the default null = ALL rows (preferred — the block sees the full dataset). Set a positive number only to cap intentionally (e.g. a small preview); a low cap truncates the data the block sees. | |
| datasource_id | No | Datasource UUID — auto-creates a SELECT * query against it. Mutually exclusive with query_id. |