Woops! I accidentally uploaded duplicate records into Salesforce!

A client of ours recently accidently uploaded the same data twice into Salesforce and needed to delete the additional unwanted records. In this tut, we will show you how to do this using dataloader;

Step 1

Firstly you need to create a tabular report of all the fields that you think have been duplicated. In this example, I have I have 374 records instead of 187.

Ensure that you include the unique ID for the records in the report.

Step 2:

Export the report as a CSV file

Step 3:

We want to remove one instance of each record. The best way to do this in excel is to remove duplicates using an appropriate column of information.

Note: In my case every record has a unique ID number that is auto populated. If this is the case we can’t use that to remove duplicates. Instead we will remove duplicates using ‘full name’

Step 4:

We now have a single instance of each record, save your CSV down and call it something like ‘records to delete’.

We can now remove these out of Salesforce using Dataloader.io.

Step 5:

Go to dataloader.io and login with your Salesforce credentials

Step 6:

On the top left hand side, hover over TASK and click ‘Delete’

Step 7:

Type in the object where your records live in Salesforce and then click ‘Next’

Step 8:

Dataloader will auto map fields where it can. Because we are deleting records, the main thing that we need to map though is the unique record ID (just ensure you have mapped this) and then click ‘Next’

Step 9:

Click on Save & Run

Step 10:

You will see an overview of whether the deletion of records has been successful or not.

In the instance that it has not been successful, simply click on the error link and you can open up a CSV file where you will be provided with reasons as to why the error occurred.

Once done, you can jump back into Salesforce and check the record count in the object using the ‘All’ list view.