In Salesforce, we have a robust data management tool, and that is Data Loader. It is more efficient than other data management tools offered in Salesforce. It also has one unique feature to upsert records, which means we can update, insert, or create records within one operation.
In this Salesforce tutorial, I will explain to you the Upsert feature of Salesforce and also the procedure to upsert data with Data Loader in Salesforce.
What is Upsert in Salesforce Data Loader
Upsert is a combination of “update” and “insert.” It allows us to insert new records and update existing ones in a single operation, making data management more efficient.
In Salesforce, Data Loader Upsert is an operation in Data Loader in which we can operate both Updates and Insert to an existing record in Salesforce.
Upsert Data with Data Loader in Salesforce
To upsert the data with the data Loader in Salesforce, ensure you have access to the records in which you want to upsert the data.
In this example, I will explain the data upsert operation by upserting the leads data. Now follow the below steps, to upsert data using the data loader.
1. To update lead data, we need the required fields: Company Name, Last Name, and Status. Now, we need to create a CSV file with these fields, and for that, first, we will export the details of leads in a CSV file with these fields for the reference of creating a new CSV file.
2. To export the leads, open the data loader, log in with your credentials, and click on the Export button. Then select the required fields of Leads, which are Company Name, Status, ID, and Last Name.
Then click on the Finish button to complete the export operation and save the export in a CSV file.

3. Now, from the exported CSV file, copy the Header columns and IDs of the records that you have to update.

4. Create a new CSV file and enter the header column copied from the exported CSV file. Enter the ID of the fields that you have to update, then enter the fields for new records except for the ID field.
You can refer to the below image to create a CSV file for the Upsert operation.

In the above CSV file, the leads with ID are the ones that will be updated and the lead records without ID are the ones that will be inserted or created in this upsert operation.
5. Open the data loader login with your credentials and click on the Upsert button.

6. In this step, we will select the data object in which we have to upsert the records and, for that, activate the checkbox Show all Salesforce objects and then select the object.
In this example, I have selected the lead object and, after this, browse the CSV file that we have created in the above steps.
After this, click on the Next button.

7. After the initialization of the selected CSV file, click on the OK button.

8. In this step, select the field between the field and email to match the selected object and click on the Next button.

9. In this step, we will do the mapping between the records of the CSV file and the Object’s Lookup field names. To do that, click on the button Create or Edit a Map, then in the next window, click on the button Auto-Match Fields to Columns.
As we click on this, the fields will be auto-matched with the column headers of the CSV file. After this, click on the OK button and then click the Next button.

10. In this step, select the folder to save the location for the Errors and Success file in the upsert operation that can be accessed later.
At last, click on the Finish button.

11. In this step, click on the Yes button to proceed with the upsert operation.

12. After completing the upsert operation, we will get a message of success and errors that occurred during the operation. In this case, we can see that it displays 9 successful upserts and 0 errors.
To view the success records, click on the button View Successes.

Now, in the Data Loader CSV viewer, we can view the records that were successfully upgraded.
In the above image, we can see that 6 records were updated, and 3 records were inserted in this upsert operation.

In this way, we can create and update data in Salesforce using the Data Loader Upsert.
Conclusion
Upserting data with Salesforce Data Loader is useful for Salesforce data management since it inserts and updates data in a single operation. It streamlines data management processes, improves efficiency, and ensures the accuracy of Salesforce records.
By following the blog, you might have good insights into the Upsert feature of Data Loader, and by following the above steps, you will be able to perform Upsert operations to manage the data of your org.
You may like to read:
- How to Update Data with Data Loader in Salesforce
- How to Delete the Records Using Data Loader in Salesforce
- How to Export Salesforce Users Data With Data Loader
- How to Insert Null or Blank Values with the Salesforce Data Loader
- How to Mass update Account Ownership with Data Loader in Salesforce
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.