Flow: How To Use “Delete Records”

As “Delete Records” is one of the data element, it will have directly impact on your real records so use it carefully. There are two ways to define what records to delete:

flow delete records - setup
1. Use a Record or a Record Collection

When you stored a record inside a record variable or a collection variable, the Id should automatically be saved in there as well. Then in the Delete Records element, you can directly assign that variable for deletion.
The most common case is to create a record variable that allows for input and enter it here, so when the flow is trigger, the system will catch the record Id, and then this record will be deleted

2. Specify Conditions
flow delete records - conditions

If you are overly cautious as I am, you might find this method safer. Here you can manually key in all the conditions for deletion, so you can double check that you are not deleting the wrong records.

Check Out How Delete Records Can Be Used In Real Cases!
No posts found.

Official Salesforce Help Article On Delete Records

Subscribe
Notify of
guest

3 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Jen L

In your example, say there are 10 Accounts in the COLD status, and I put them in a Record Collection Variable on the DELETE RECORDS element. Is that 1 DML or 10 DMLs?

Same question for Specifying Conditions…..
Does that result in 1 DML and 1 SOQL, or 10 DML and 10 SOQL?

I’m looking to delete 40,000 records, so this is a big consideration for me.

Nurzhigit

Hello,
I built a flow,that count me related Contact object number in the Account object when Contact object cretated or Updated.
But,now I also want update the Contact object number in the Account object when Contact object deleted.
How can I solve this case?