You are here:
Delete Records Element
Identify Salesforce records to delete by using the IDs stored in a record variable or record collection variable, or by specifying conditions.
Required Editions
| View supported editions. |
This video explains how to use data elements to create, update, and delete records using a flow.
View this video 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 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.
- 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.
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.
Usage
- 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 executes 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.

