function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SFDoodSFDood 

How to delete data using 'Apex Data Loader'

 

I have imported few data sheets into SF - sandbox. But there are quite a lot of duplicates being created.

I want to delete the data using Apex Data Loader. I am new to the this data loader. When I login to the data loader and Use the 'Delete' option, it asks to select the SF object. This is fine. But then it also needs a CSV file. I am here to delete the data.(Not import/Update). Kindly help me

 

Best Answer chosen by Admin (Salesforce Developers) 
OxeneOxene
Deletion of data primarily depends only on the Id of the records present in the csv file that you provide and the object. Please make sure that you have the ids of the records that you want to delete, specified in the csv file that you provide.

All Answers

kxa422kxa422

To delete, you need to be able to identify the records you want to remove. For you case, you need to export the content of your table in a CSV file. Keep in that CSV file the records you'll like to remove.

When you ran the Apex Data Loader again, use that CSV file to remove the records.

OxeneOxene
Deletion of data primarily depends only on the Id of the records present in the csv file that you provide and the object. Please make sure that you have the ids of the records that you want to delete, specified in the csv file that you provide.
OxeneOxene
Deletion of data primarily depends only on the Id of the records present in the csv file that you provide and the object. Please make sure that you have the ids of the records that you want to delete, specified in the csv file that you provide.
This was selected as the best answer
WmWm
Run a report and get the ids of all the records you want to delete. Save it as CSV. When you delete these records using the datalodaer just feed this file into it. Hop ethis helps!
dmchengdmcheng

As the others have mentioned, you first need to export the data you want to delete so you can get the record IDs, then you use that CSV file for the Data Loader's Delete action.

 

If you choose to export through a report to Excel, remember that the record ID is truncated to 15 characters instead of 18 characters.  You must use the Excel connector's FIXID function to correct this before using the CSV file for deleting.

 

If you export through Data Loader, the record ID is 18 characters, so this usually the better method.  However, the interface is not as easy to use.

sarvesh001sarvesh001

hi 

Amanda RollinsAmanda Rollins
Hello, I have uploaded 3,100 records to a custom object. I realized that I had a field input wrong and I couldn't figure a way around it. So I deleted the data, fixed my csv. and went to re-insert the records. When I tried to delete the records and got some "invalid ID" message (because my csv didn't have an id set). I went to the storage area and looked and it still shows all 3,100 records. I tried to upsert/insert/delete and the data loader said "storage limit exceeded". I want to completely delete these records and start over. But I don't know how to do this.