What it does
Query rows in a table. query takes where, any (AND-ed with where when both are set), search, sort, page, limit, group_by, or include, fields to return only some columns, member (a member id from list_members) for one site member's rows, and visibility (shared, private or all) on an own_and_shared table. Each row has _member: the member it belongs to, or null. _created_by and _updated_by say who wrote it: { type (bot, owner, member, visitor, reviewer or system), agent_id for an agent, name }, with the current name. Sort keeps the first occurrence of each column and allows at most 5 distinct columns.
Plans
Works on every plan: Free, Basic, Pro and Ultra.
Parameters
| Name | Type | About |
|---|---|---|
namerequired | string | The table to read. |
query | object | Query options: where, search, sort, limit, page and the others query_table takes. |
fields | array of string | Column keys to return, such as ["slug","title"]. id, position, revision, created_at, updated_at, _member, _created_by and _updated_by always come back. Filters, search and sort can use other columns. Not with group_by. It keeps long text columns out of the response. |
site_id | string | Only for a site shared with you (whoami lists them): read or change that site's data as its member. |
Example
Call list_rows with these arguments:
{
"name": "recipes",
"fields": [
"title",
"minutes"
]
}
Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.
Related guides
- Search, filters and pagingLet visitors find rows in a long table.