Skip to content

Update Records (Relational DB) v1.0.2 Help

Updates records in a relational database table that match specified criteria.

How can I use the Step?

The Step lets you modify data in a relational database table within a workflow. It can be helpful for various use cases, such as updating customer information, tracking sales orders, and maintaining inventory levels.

How does the Step work?

You specify the database table, provide the filters to identify the records to update, and give the object to construct the SQL query. The Step takes these inputs and executes an SQL UPDATE statement against the selected table.

Database settings

To set up the section, specify the database, schema, and table you want to use:

  • For Database, select a database name from the list provided by the Relational DB service or input one using the Merge field. If you use the Merge field, the options to choose an internal or an external database appear - make sure to select an appropriate one.
  • For Schema, select the schema name containing the table.
  • For Table, select the table name where you want to insert new record(s).

Query settings

The Step selects records that satisfy your provided filters and uses JSON objects to construct an SQL query: the keys correspond to the table fields (columns), and values form the table record (row). If you don't enter any filters or leave all filters blank, the Step updates all records in the table specified.

To modify specific records in the table, follow these steps:

  1. Click +Add a new filter, and provide at least one condition. For each condition, you can specify:

    • Column: The column name on which you want to apply a condition.
    • Operator: An operator that defines how to compare the column value with the value specified.
    • Value: A value you want to compare with the column value.
  2. Specify the object(s) using one of the following tabs. If set both tabs, the Step only applies configuration from the active one:

    • For Build an object, add the key-value pairs to build a JSON object. You can only create a single record with this option.
    • For Select a variable, complete the Name field using the Merge field variable. You can provide an object to create a single record or an array of objects to create multiple records. The array of objects has no size limit, but the Flow execution timeout is applied (30 seconds by default).
  3. Optional: Enable Log query to add query information to the session log.

Caution: If entering the condition operator via the Merge field, we don't recommend using in, is null, and is not null options.

Merge field settings

The Step returns the result as a JSON object and stores it in the Merge field variable. So you can use the retrieved data in subsequent Steps or other Flows.

Output example

The output JSON object contains information about the number of records (rows) that the Step has selected from the table. For example:

json
{
    "rowCount": 1
}
{
    "rowCount": 1
}

Error handling

By default, the Handle error toggle is on, and the Step handles errors with a separate exit. If any error occurs during the Step execution, the Flow proceeds down the error exit.

If the Handle error toggle is disabled, the Step does not handle errors. In this case, if any error occurs during the Step execution, the Flow fails immediately after exceeding the Flow timeout. To prevent the Flow from being suspended and continue handling errors, you can place the Flow Error Handling Step before the main logic or your Flow.

Reporting

After the Step completes, it generates a report that includes its execution status and other details. You can customize the report by adjusting the Step's log level and adding tags.

Log level

By default, the Step's log level matches that of the Flow. You can change the Step's log level by selecting an appropriate option from the Log level dropdown.

Tags

Tags provide a way to classify and search for sessions based on their attributes. To create a new tag, specify its category, label, and value. You can then use tags to filter and group the sessions in the report.

Service dependencies

  • flow builder v2.34.0
  • postgresql v2.4.0

Release notes

v1.0.2

  • Add an external database selection for Database

v1.0.0

  • Initial release