Delete Data in Salesforce

Delete Salesforce records in Dataloader from MuleSoft by creating a Delete task with a CSV file containing the record IDs. Save and run the task immediately, schedule it, or reuse it as a template.

You need a CSV file with the IDs of the records to delete in one column. Each task stores your connection, object, ID mapping, and options so you don’t repeat setup every time.

Start a new delete task and select the Salesforce org and object whose records you plan to delete.

  1. Click New Task then click Delete.

    New Task menu with Delete selected.

  2. In the Connection dropdown, select the Salesforce connection you want to use.

    Your login credentials apply to your default connection. To use a different Salesforce connection, click the + icon and create a connection.

  3. For Object, select the object you want to delete data from, such as Account, Contact, or Lead. Click Next.

    Connection and object list with Contact selected for a delete task.

Object list: Use Quick find to search for an object by name. Use Menu to filter Standard or Custom objects or to show or hide object names.

Upload the CSV file that lists the record IDs to delete.

  1. Use a file from your computer or from a cloud repository.

  2. To upload the CSV file, click Upload CSV, or drag the file into the upload area.

    For more information, see Connecting to Box, Connecting to Dropbox, Connecting to FTP, and Connecting to SFTP.

    Upload CSV step for a delete task with local file and cloud storage tabs.

Select the column from your CSV file that contains the Salesforce IDs of the records to delete. Dataloader ignores other columns. If a column header is Id, Dataloader maps it automatically. Otherwise, click the field that contains the ID, then click Next.

Field-mapping step with the Id column selected for delete IDs.

Review the summary page, adjust the task name and API options, then save the task or run it immediately.

  1. On the summary page, review the overview of your task.

  2. If necessary, change the task name.

  3. Specify the Bulk API or the Batch API and set the batch size if needed.

  4. If necessary, open Advanced Settings in the task configuration.

  5. Click Save to save and run later, or Save and Run to run immediately.

Delete task run step showing summary, Bulk API, and Save and Run.

  1. Set how often the task runs: Hourly, Daily, Weekly, or Monthly.

  2. Set the time zone if needed.

  3. After you create the task, open scheduling from this summary page (edit the task and return here) or from the Schedule button on the task list.

  4. Use the Scheduled tab to find scheduled tasks.

Salesforce Bulk API uses REST principles and is optimized for loading or deleting large data sets. Salesforce processes records asynchronously by running submitted batches in the background.

Bulk API has some restrictions. For example, related object exports are not supported.

Bulk API processes data in larger batches than Batch API, which lowers API usage per operation when you load large volumes. For more information, see Introduction to Bulk API 2.0 and Bulk API.

When the Bulk API checkbox is cleared, Batch API is in use.

Salesforce Batch API uses SOAP principles and is optimized for real-time client applications that update small numbers of records at a time. Although the SOAP API can process large numbers of records, data sets with hundreds of thousands of records are less practical that way.

For large volumes, Bulk API is the best option. Batch API processes data in smaller batches than Bulk API, which increases API calls per operation when you process large volumes.

FeatureBulk APIBatch API
ProtocolRESTSOAP
Best forLarge data sets (10,000+ records)Smaller data sets (under 10,000 records)
ProcessingAsynchronous batchesReal-time
API callsLower (larger batches)Higher (smaller batches)
Related object exportsNot supportedSupported

You can configure your task to email you whenever it runs. You can add multiple recipients as well as multiple CCs to the sent email.

When using the free edition of Dataloader from MuleSoft, you are only allowed to have one task set up to send email notifications. Dataloader.io Professional and Enterprise editions allow you to use email notifications on unlimited tasks.

These options appear on the Advanced settings page.

  • Hard Delete Records: When you enable this option, Dataloader deletes records immediately instead of placing them in the Salesforce Recycling Bin. Available only with Bulk API.
  • Serial Mode: Bulk API only. Processes batches one at a time in Salesforce (which helps avoid database contention). This option can significantly increase processing time for a load.
  • Timeout: The maximum time a task can keep running. When the task reaches the threshold, Dataloader cancels it automatically. The default timeout is 2 hours.

Advanced settings for hard delete, serial mode, and timeout on a delete task.