Skip to main content

Update a row in a table

Stepupdate-rowsaveside effects

Finds the row in one of your tables that matches and changes the columns you choose.

At a glance​

PropertyValue
Step nameupdate-row
ResourceClusterStep (lumen.ai/v1alpha1)
Palette group, categorysave, tables
Credits1 credit each time it succeeds
Side effectsyes It changes something outside Lumen, so a retry asks first and a test shows what it would do instead of doing it.
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
rowIdstring
updatedboolean

Settings​

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

SettingTypeDefaultDescription
sheetrequiredstring-Name of the table whose row to update.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 finds the row: the oldest one that passes every test.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-
setrequiredmap of string-Set is what to change, as add-row's mapping: a column name to "{field}", text with {placeholders}, or a plain value. A value that turns out empty leaves its column as it is.
ifMissingstring"fail"IfMissing is fail (the default) or skip, when no row passes.one of fail, skip

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

Example​

Put a supplier on hold

config
set:
status: on-hold
sheet: Suppliers
where:
- column: name
op: eq
value: '{supplier}'

Use it in a flow​

A node that runs update-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: update-row-example
namespace: tenant-acme
spec:
displayName: "Update a row in a table"
triggers:
- id: start
ref: {name: manual-run}
next: [update-row]
nodes:
- id: update-row
stepRef: {name: update-row}
config:
set:
status: on-hold
sheet: Suppliers
where:
- column: name
op: eq
value: '{supplier}'