younifyd
Menu

Upsert Record

Create a record, or update it if one already exists with the same primary key

Use it in a workflow

  1. Add a step and choose the Data Table connector.
  2. Pick the Upsert Record action (under database).
  3. Fill in the fields below, then reference the result from later steps as {{upsertRecord.response.data}}.

Fields

tableSlugstringrequired

The data table to upsert into

datastringrequired

JSON object with the record's fields, including the primary key field(s) — those determine which record is created or updated

patchboolean

Off (default): an existing record is replaced entirely, so fields you leave out are cleared. On: only the fields you send are changed and every other field is kept. A record that doesn't exist yet is always created in full.

Examples

Change one field and keep the rest

With patch on, only status changes on order_123; every other field is kept. If the record doesn't exist it is created from the data given

json
{
  "tableSlug": "orders",
  "data": "{\"id\": \"order_123\", \"status\": \"shipped\"}",
  "patch": true
}

Sync a record from an external system

Creates the record if id 'order_123' doesn't exist yet, or fully replaces its data if it does

json
{
  "tableSlug": "orders",
  "data": "{\"id\": \"order_123\", \"status\": \"active\"}"
}

Need more? See the Data Table guide for connection setup and behaviour shared by every action.

Was this page helpful?
Upsert Record — Data Table — Documentation