Blog

SimpleImport: Master-detail insert, update or upsert

This article will cover:

  • What is the difference between insert, update and upsert.
  • Choosing an import type.
  • Using matching conditions with updates and upserts.

What is the difference between insert, update and upsert?

When importing data into Salesforce it is important to understand the difference between the three import types.

  • Insert – Only create new records in your Salesforce Org. 
  • Update – Only update existing records in your Salesforce Org. This is only possible where a single match to an existing Salesforce record is achieved.
  • Upsert – Where a match can be found (see Update above) perform an update, if no match then create a new record.

For update and upsert, SimpleImport introduces matching conditions to define logic for matching existing records. This will become available for use when using update or upsert and is covered in more detail later in this article.

Choosing an import type (master-detail)

You’ve chosen your two related objects, it’s now time to choose the import types for each object.

Note: using update or upsert on a detail object import is considered an advanced import and should only be used if you’re confident in understanding the outcome.

When working with two objects, Step 1 and Step 2 will be presented in the UI.

  • Under Step 1, select insert, update or upsert under Import Type.
  • Select Step 2.
  • Select insert, update or upsert under Import Type.
  • If you have selected insert for both objects, press Next to continue.
  • If you have chosen update or upsert for either object, continue reading Using matching conditions.

Using matching conditions

Updating and upserting into Salesforce couldn’t be easier with the quick-to-adopt matching conditions functionality in SimpleImport. For each object that has the import type set to update or upsert, use the matching conditions tool to define criteria to find existing records in your org. This can range from simply matching existing records by their Salesforce Record ID, or a combination of fields such as Last Name, Phone Number and Email Address.

When update or upsert is chosen, the matching conditions section will automatically create one row ready to complete. Let’s get started.

  • Under File Column, choose a column header from the file that contains the data you want to use for matching.
  • Under Salesforce Field, choose the field label that contains the data you want to match with.
  • To add more matching conditions, select Add Row and repeat the two steps above for each added row.
  • Repeat these steps for both objects until all objects configured for an update or upsert have valid matching conditions.

Note: the matching conditions query builder will create an AND query to find existing records. It must result in finding a single record.

Summary

With the import type chosen and matching conditions set, it’s time to move on to the field mapping. Continue to the next article.


Back to the SimpleImport User Guide

Leave a Reply