Skip to main content

Look up a row in a table

Stepfind-rowread

Finds the row in one of your tables that matches, and brings its columns into the steps after it.

At a glance​

PropertyValue
Step namefind-row
ResourceClusterStep (lumen.ai/v1alpha1)
Palette group, categoryread, tables
Credits1 credit each time it succeeds
Side effectsno
Installation must providenothing

Inputs​

PropertyValue
Needsnothing
Producesfields
Works onitem one document at a time

Needs and Produces are data types (file, text, fields, email). The editor offers a step only where what it needs is already on the path. See Documents and data.

Outputs​

A later node references an output as {nodeId.field} in text, or nodeId.field in a condition.

OutputType
foundboolean
countnumber
rowIdstring
rowsarray
truncatedboolean

More outputs are declared in the setting returns.

Settings​

Set under config: on the flow node. Text settings may contain {nodeId.field} placeholders.

SettingTypeDefaultDescription
sheetrequiredstring-Name of the table to look the row up in.minLength 1
basestring-Name of the base (database) the table is in. Optional: when set, the table must belong to this base.minLength 1
whererequiredlist of object-Where are the tests a row must all pass.minItems 1; maxItems 8
where[].columnrequiredstring-minLength 1
where[].opstring"eq"Op is eq (the default), contains (text, case-insensitive), or gt, gte, lt, lte (numbers, amounts and dates).one of eq, contains, gt, gte, lt, lte
where[].valuerequiredstring-
allboolean-All brings back every match, up to limit, as the list field rows. The first match is always the fields.
limitinteger-Limit is how many rows all brings back; 50 when unset, 10000 at most. When more rows match, the output truncated is true.minimum 1; maximum 10000
prefixstring-Prefix goes before each column name in the fields, so a looked-up value does not replace a field of the same name.maxLength 32
returnslist of object-Returns lists the columns later steps will use, so the editor can offer them. All of the row's columns are brought back either way.maxItems 100
returns[].namerequiredstring-minLength 1

The full JSON Schema of these settings: find-row.schema.json.

Example​

Look up a supplier by name

config
returns:
- name: contact
- name: city
- name: status
sheet: Suppliers
where:
- column: name
op: eq
value: '{supplier}'

Use it in a flow​

A node that runs find-row goes under spec.nodes of a Flow. Give it any id, and list the next node ids in next.

flow.yaml
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
name: find-row-example
namespace: tenant-acme
spec:
displayName: "Look up a row in a table"
triggers:
- id: start
ref: {name: manual-run}
next: [find-row]
nodes:
- id: find-row
stepRef: {name: find-row}
config:
returns:
- name: contact
- name: city
- name: status
sheet: Suppliers
where:
- column: name
op: eq
value: '{supplier}'