Upsert

This action uses Salesforce native UPSERT mechanism that combines two operations:

  • INSERT: If a record doesn't exist, Salesforce creates a new one.
  • UPDATE: If a matching record is found, Salesforce updates the values in the mapped fields of the existing record.

Upsert action updates all the matching records, even if there were no changed values.

To determine if a record is already exists, Salesforce relies on External ID fields. External ID in Salesforce is a custom field that has the "External ID" attribute and uniquely identifies records. There can be multiple External Id fields in a Salesforce object.

Action Settings

Setting Description
Table An object to load records to.
External Id The object External ID field to use for matching records.

Action Parameters

Upsert action parameters correspond to the fields of target object. You must map at least the parameters corresponding to the required target table fields, and the parameter corresponding to the selected External ID field.

Result

The records are inserted or updated in the target table.

Example

Here is an example of Upsert action in the Target component of Data Flow. This example loads Accounts to Salesforce.

Upsert action in data flow