[SalesForce] How to prepare the CSV file for a successful upsert

I would like to import several contacts into Salesforce and avoid duplicates. I would like to do this via upsert (not the the import wizard). For the upsert I plan on using dataloader.io.

I have performed an export of the Account and Contact objects in two separate CSV files. For the export of the Contact object, I have the (record) Id and Account Id.

I am not sure how to update the working CSV that contains new Account and Contact information with the information from the exported sheets.

What are the steps to preparing the working CSV to upsert into Salesforce?

Best Answer

When performing an upsert you can avoid duplicates by matching on either the Salesforce ID or custom External ID type field. If your performing an upsert, or update using dataloader.io, you must map a column to the Salesforce ID or an external ID.

Using dataloader.io, the ~ steps: Import your parent Account records.

  1. Select the Import option
  2. Select the import operation type – upsert.
  3. Select the object you wish to import data into Account.
  4. Verify Mapping Between Fields
  5. Click Next Upload the CSV file you wish to import by clicking the Upload CSV button.

Import your child Contact records, ensure the Account field contain the name of your Accounts.

  1. Select the Import option
  2. Select the import operation type – upsert.
  3. Select the object you wish to import data into Contact.
  4. Verify Mapping Between Fields
  5. You'll need to Lookup the Account Ids you've just imported, on the mapping file, select your Account field, and choose the "Lookup via Account" Account Name.
  6. Click Next Upload the CSV file you wish to import by clicking the Upload CSV button.

Note, because you are upserting from an export ensure your upsert files do not contain any system fields.

Good Luck.

Related Topic