Skip to main content
All CollectionsSalesforce How-Tos and Best Practices
Importing Salesforce Data with New and Existing Records
Importing Salesforce Data with New and Existing Records
Engineering Swantide avatar
Written by Engineering Swantide
Updated over a year ago

When uploading data into Salesforce, such as a list of accounts, you may find that your CSV file contains a mixture of records that already exist in Salesforce and net new records. We have a few options to go about this:

Upserting records, as the name suggests, is a combination of updating existing records and inserting new records. In order to do this effectively, we need to pull the unique identifier representing the existing record in Salesforce. It's important to note that we will need to have some way of matching the records in Salesforce to the ones in your CSV file - more on that later

Step 1: Export records in Salesforce

For the sake of this article, we'll be using an Account upsert as an example. In Salesforce, create a report of all accounts in your system. Edit the filters to be all accounts, with a create date of all time. The report should include Account ID, Account Name, Website, and any other fields that might represent a unique identifier between existing accounts in Salesforce and the accounts in your file.

Step 2: Add a tab in your file to insert the recently exported data.

First, add a column to your existing file as a placeholder for Account ID. Add 1 column for each data point you are looking to match in your data set (e.g. Account ID - Account Name and Account ID - Website). With the existing data from Salesforce in the same file as the data you wish to upload, we will now attempt to pull the Account ID Using index/match in Excel or Google Sheets. ** Please note that if you are doing this with an extremely large data set (>10K records), it is important to use index/match instead of vlookup. Vlookup is not case sensitive, and Salesforce will repeat characters in their record IDs but with different cases.

You can then consolidate the two Account ID matches into one master Account ID column, which will be used in the upsert

Step 3: Upsert using Dataloader

Log into dataloader.io using your Salesforce credentials, and go to upload the data. Note that with Salesforce's duplicate rules, it will possibly still flag that some records are duplicates. If you have a small enough dataset, this can give you an even smaller population to spot check if there is a matching account in Salesforce. For the remaining records, you can download the error file and re-upload after spot checking to see if there are any other account IDs in the dataset.

Did this answer your question?