Find rows
Look up rows in a collection.
data.query finds rows in a collection and reads the first into the run.
Settings
| Setting | What it does |
|---|---|
| Collection | The collection to search. |
| Where | A condition, such as user = {user.id}. Empty matches every row. |
| Sorted by | A column, then desc for largest first, such as score desc. Empty keeps the oldest first. |
| Limit | How many rows to find. The default is 1. |
| Read the row as | The name to read the row under. Its columns are {row.column} unless you name it. |
Ways out
| Way out | Taken when |
|---|---|
Found | At least one row matched. |
Nothing found | None did. |
Produces
| Token | Value |
|---|---|
{row.id} | The number of the row found |
{row.column} | Each column of the row |
{rows.count} | How many rows matched |
{rows.all} | Every row found, up to the limit, as a list. Run code reads it as ctx.rows.all |
{name.count}, {name.all} | The same, when the row is named. Later finds don't replace them |
Notes
- Name the row with Read the row as when a later step finds a different row and you still need this one.
- To work with several finds in one Run code step, name each one. Find
user = {user.id}asmineandteam = {option.team}asteam, then readctx.mine.allandctx.team.all. - The canvas shows
Collection where condition.
Example
Find the member's open ticket with user = {user.id} and status = open. If Nothing found, create one.
Related
Was this page helpful?