Update Row
The Update Row action step allows you to update a row or multiple rows in a table by a given condition.
To run this action, you need to specify the filter condition to find the row to update, for example:
// id = 23
{{ui.table.updatedRow.data.id}}And you also need to specify the values to update. You can do this in the following ways:
Update values field by field:
// name = 'John'
{{ui.table.updatedRow.data.name}}Switch to JS mode (JS button) and send the updated values as an object:
{{ui.table.updatedRow.data}}or:
{
name: "John",
age: 30
}
This object will be sent to the server and converted to an UPDATE statement, for example:
You can check the action's Payload tab to see the actual object sent to the server.
Filters with empty values are omitted from the generated WHERE clause. This applies to null, undefined, an empty string, an empty array, and an array containing only empty values.
An empty array used with IN does not create a condition that matches zero rows. The filter is removed instead. For example:
is evaluated as:
This can update unintended rows. If all filters are removed and Bulk Update is enabled, the action can update every row in the table.
Validate dynamic filter values before running the action. For bulk operations, add a Condition step before the Update Row step.
Unset fields will be presented as undefined and will NOT be used in the UPDATE statement:
You can always adjust the data before sending it.
Examples
Adding additional values
The created_at column must exist in the table schema, otherwise it will not be sent.
Changing values
Deleting unnecessary values
or:
Joining array values
Using default values
Additional settings
If you need to update multiple rows, you can select the Bulk Update checkbox in the action's settings.
We recommend being very careful with this setting since it can update all rows in the table.
Last updated
Was this helpful?