---
schema_version: "1"
id: e17044acf60e01fe958398897da8c4164a95c74c82ae65d72267078a19d0e8a6
title: Delete Data in Salesforce
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/dataloader/dataloader-help/guides/delete-data.md
canonical_url: https://developer.salesforce.com/docs/platform/dataloader/guide/delete-data.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: f09d7f2f33f7f0e1bb1e4570431e0fbd2c04f87517bf2582d7fd1749df4dc5e3
products:
  - Dataloader from MuleSoft
---
# 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.

## Step 1. Create and Configure a Delete Task

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.](https://developer.salesforce.com/docs/media/delete-data-new-task-delete-menu.png '{"class": "image-framed image-sm"}')

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.](https://developer.salesforce.com/docs/media/delete-data-connection-object-selection.png '{"class": "image-framed image-md"}')

**tip:** _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.

## Step 2. Upload the File

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](https://developer.salesforce.com/docs/platform/dataloader/guide/connect-box.md), [Connecting to Dropbox](https://developer.salesforce.com/docs/platform/dataloader/guide/connect-dropbox.md), [Connecting to FTP](https://developer.salesforce.com/docs/platform/dataloader/guide/connect-ftp.md), and [Connecting to SFTP](https://developer.salesforce.com/docs/platform/dataloader/guide/connect-sftp.md).

   ![Upload CSV step for a delete task with local file and cloud storage tabs.](https://developer.salesforce.com/docs/media/delete-data-upload-csv-step.png '{"class": "image-framed image-md"}')

## Step 3. Select the ID Field

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.](https://developer.salesforce.com/docs/media/delete-data-select-id-field-mapping.png '{"class": "image-framed image-lg"}')

## Step 4. Save and Run Your Task

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](#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.](https://developer.salesforce.com/docs/media/delete-data-summary-run-step.png '{"class": "image-framed image-lg"}')

<!-- Shared: Schedule the Task, Bulk API, Batch API, comparison table, Email Notifications -->
<!-- Edit this file to update import-data.md, export-data.md, and delete-data.md at once -->

### Schedule the Task

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.

### Bulk API

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](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_intro.htm).

### Batch 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.

### Bulk API vs Batch API

| Feature                | Bulk API                          | Batch API                              |
| ---------------------- | --------------------------------- | -------------------------------------- |
| Protocol               | REST                              | SOAP                                   |
| Best for               | Large data sets (10,000+ records) | Smaller data sets (under 10,000 records) |
| Processing             | Asynchronous batches              | Real-time                              |
| API calls              | Lower (larger batches)            | Higher (smaller batches)               |
| Related object exports | Not supported                     | Supported                              |

### Email Notifications

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](https://dataloader.io/pricing) allow you to use email notifications on unlimited tasks.


## Advanced Settings

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.

<!-- Note: Serial Mode bullet also appears in import-data.md and export-data.md. -->

- **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.

<!-- Note: Timeout bullet also appears in import-data.md and export-data.md. -->

- **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.](https://developer.salesforce.com/docs/media/delete-data-advanced-settings.png '{"class": "image-framed image-md"}')

## See Also

- [Export Data from Salesforce](https://developer.salesforce.com/docs/platform/dataloader/guide/export-data.md)
- [Importing Data into Salesforce](https://developer.salesforce.com/docs/platform/dataloader/guide/import-data.md)
- [Managing Tasks](https://developer.salesforce.com/docs/platform/dataloader/guide/manage-tasks.md)
- [_Salesforce Developers_: Introduction to Bulk API 2.0 and Bulk API](https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/asynch_api_intro.htm)
