List the values a reference column can point at
list_reference_options
Lists the rows another collection offers as targets for a reference column.
Use it so a value written by create_row or update_row points at something real, since without it a reference value is a guess. Pass the collection being referenced and the column holding the value to store, usually its primary key.
Each option comes back as a value and a label, read from the collection's first title, name, slug, label or email column, which the response names in labelColumn. search narrows by that label, and ids fetches specific rows back so an existing value can be shown as a name rather than a bare id. It returns 20 rows per call and caps limit at 200, with hasMore telling you whether to page. See Relationship fields.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
schema |
string | No | The schema the collection lives in, exactly as list_collections reports it. Leave it out to use the site database's own default, which is right unless list_collections showed something else. A site on the newer database always uses its default. |
name |
string | Yes | The collection being referenced, exactly as list_collections reports it. |
valueColumn |
string | Yes | The column whose value the reference stores, usually the primary key. |
search |
string | No | Narrows the options by label. |
ids |
array of strings | No | Fetches these specific rows, to turn stored values back into readable labels. At most 200 are read, and search, offset and limit are ignored while it is set. |
offset |
integer | No | Rows to skip. Defaults to 0. |
limit |
integer | No | How many rows to return. Defaults to 20 and is capped at 200. |