Create / Update record

This action merges Create and Update logic into a single operation, driven by a JPQL query instead of a single entity ID.

How does it work?

  1. Query First: The operation starts by executing a JPQL query to fetch a matching record.

  2. Update if Exists: If the query returns an existing record, it is updated with the provided data.

  3. Create if Missing: If the query returns no results, a new record is created instead.

Create / Update record

Querying

The field Query type has two options: Query or Mapping.

Query

The field Query string accepts a JPQL query that filters records before applying the creation or update process.

In the example below, the scenario will search for the user with the clause code = 'sale'. If it is found, its data will be updated with the ones provided in the payload.

Query string

Mapping

The query mapping feature provides an interactive way to select model fields, supporting all JPQL operations, including:

  • Comparison operators:

    • = (equals)

    • > / < (greater/less than)

    • >= / <= (greater/less than or equals)

  • Set operations:

    • IN

    • NOT IN

  • Null checks:

    • IS NULL

    • IS NOT NULL

Key Features
  • Supports unlimited filter elements

  • Interactive field selection interface

You can combine several filter clauses in the Mapping. They will all be applied with AND predicate.

The values put in the mapping are used only for filtering the records. If you want to set the value of the data record in the creation or update process per se, you need to set it in its dedicated field below too.

Mapping

Non-required fields are hidden by default. Enable the option Show Advanced settings on the bottom to display them.