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.
A collection that does not exist in the site's database is refused with a 404 and the message "That collection was not found in your database!".
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
projectId |
string | Yes | The site id. |
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. |