---
schema_version: "1"
id: af1a0e3cffb455c68b9d392dd1f4d6a40789d336d05a1d6066dc5a0bcc7c16a7
title: Delete Records Element
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/flow_ref_elements_data_delete.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_data_delete.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 78f3bc39c94d0f1e119a9f9fdfbb224513feb121b9637939de4d807aff4f6f7a
description: Identify Salesforce or Marketing Object records to delete by using the IDs stored in a record variable or record collection variable, or by specifying conditions.
products:
  - Flow Builder
  - Salesforce Platform
release: "264"
---
# Delete Records Element

Identify Salesforce or Marketing Object records to delete by using the IDs stored in a record variable or record collection variable, or by specifying conditions.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=platform.flow_ref_supported_editions.htm&amp;release=264.0.0&amp;type=5" title="Learn about the editions and user interfaces that support Flow Builder. Some Flow Builder features integrate with other Salesforce products that require additional licenses.">View supported editions.</a></td></tr></tbody></table>

This video explains how to use data elements to create, update, and delete records using a flow.

View this [video](https://play.vidyard.com/SiwVdqZ79irAgg2WUJiPob) in a separate tab.

How you choose to identify the records to delete determines what to enter in the rest of the Delete Records element.

- Use a record variable or record collection variable.
    
    If you store the IDs of the records to delete in a record variable or record collection variable, choose to use the IDs from a record variable or record collection variable. Then select the variable to use.
    
    ![Important](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_important.png)
    
    Important For the variable that you select, make sure that each record’s ID value is set. The flow identifies which records to delete based on the ID value.
    
    When you use a record collection variable to delete multiple records at once, you reduce the number of DML requests in your flow. That means you’re more likely to stay within your org’s limits. For more information, see [Flow Bulkification in Transactions](https://help.salesforce.com/s/articleView?id=platform.flow_concepts_bulkification.htm&release=264.0.0&type=5 "When a flow runs for multiple records at the same time, Salesforce creates one flow interview per record. Bulkification groups similar operations when interviews for the same flow reach the same element, helping the transaction use fewer queries and statements.").
- Specify conditions.
    
    To use conditions to identify the records to delete, choose the object, and add at least one condition to filter down the list of records.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_example.png)

Example

When a customer accepts a quote, delete the remaining quotes from the opportunity.

## Considerations for Defining Filter Criteria

- When you define multiple filters, the filter logic usually defaults to AND. However, if multiple filters have the same field selected and use the equals operator, the filters are combined with OR.
    
    For example, your filters check whether a case’s Type equals Problem (1), Type equals Feature Request (2), and Escalated equals true (3). At run time, the filters are combined to `(1 OR 2) AND 3`.
- The available filter operators depend on the data type of the selected fields. For details, see [Flow Operators in Data Elements and Record Choice Sets](https://help.salesforce.com/s/articleView?id=platform.flow_ref_operators_filter.htm&release=264.0.0&type=5 "Filter conditions narrow the scope of records that the flow operates on. For example, use filter conditions to update only the contacts that are associated with the Acme Wireless account. When you add an Update Records element, use filter conditions to narrow the scope to just the contacts whose parent account is Acme Wireless. The In and Not In operators are available only in Create Records, Get Records, and Update Records elements.").

## Usage

![Warning](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_warning.png)

Warning

- Be careful when testing flows that contain delete elements. Even if the flow is inactive, it triggers the delete operation.
- To prevent deleting records by mistake, be as specific in your filter criteria as possible.
- Records are deleted from your org the moment the flow runs the delete element.
- Deleted records are sent to the Recycle Bin and remain there for 15 days before they’re permanently deleted.
- Flows can delete records that are pending approval.

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-platform_automation-264-0-0-production-enus/60568438-ec7e-4665-acd1-7c80dcbe60d5/images/icon_note.png)

Note At run time, the record isn’t deleted until the interview’s transaction is completed. Transactions are complete when the interview either finishes or runs a Screen, Local Action, or Wait element.

#### See Also

- [Flow Operators in Data Elements and Record Choice Sets](https://help.salesforce.com/s/articleView?id=platform.flow_ref_operators_filter.htm&release=264.0.0&type=5 "Filter conditions narrow the scope of records that the flow operates on. For example, use filter conditions to update only the contacts that are associated with the Acme Wireless account. When you add an Update Records element, use filter conditions to narrow the scope to just the contacts whose parent account is Acme Wireless. The In and Not In operators are available only in Create Records, Get Records, and Update Records elements.")
- [Customize What Happens When a Flow Fails](https://help.salesforce.com/s/articleView?id=platform.flow_build_logic_fault.htm&release=264.0.0&type=5 "Learn how fault paths customize what happens when a flow fails. Choose how to notify admins, guide users, and take a follow-up action.")
- [Move and Connect Elements to Change a Flow Route](https://help.salesforce.com/s/articleView?id=platform.flow_build_logic_route_add.htm&release=264.0.0&type=5 "Identify which elements the flow runs and in what order by connecting the elements on your canvas together. To change the run order, move elements and add or remove connectors.")
- [Flow Elements](https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements.htm&release=264.0.0&type=5 "An element represents an action that the flow can run. Examples include reading or writing Salesforce data, displaying information and collecting data from flow users, runnning business logic, or manipulating data.")