How to Delete Records using Flow in Salesforce

In Salesforce, using the record-trigger flow, we can automate the process of deleting records that do not meet the required criteria.

In this Salesforce tutorial, we will learn how to delete records using flow in Salesforce, using real-time scenarios and step-by-step explanations.

Delete Record using Flow in Salesforce

While working as a Salesforce Admin for a US-based Organization that provides software solutions, I was assigned the task of if we get any opportunity in the “Close Lost” stage, then that opportunity should get deleted automatically.

To create this process automatically, we can create a record trigger flow, which will trigger on the opportunity stage changes into Close Lost, and then that record gets deleted. This will be useful to the organization for deleting records that do not meet business criteria or are not required.

Delete Records using Flow in Salesforce

Using the above scenario and the following steps, we can delete records using Salesforce Flow.

1. Log in to Salesforce Org. -> Click on the Setup -> Home Tab -> In Quick Find Box, Search for Flows. You will see an option under Process Automation -> Click on Flows.

Delete Record Using Flow in Salesforce

2. Then, click on the New Flow button to create a new flow.

Delete Record in Salesforce Flow

3. We know the record trigger flow launches when the record is created, updated, or deleted. When the opportunity stage is updated or changed to “Close Lost,” the record will be deleted. To do that, we have to select the Record Trigger flow and click on the Create button.

Delete Record using Salesforce Flow

4. As we click on the create button, we will see the flow canvas. In our scenario, the flow should trigger when we update the Opportunity record, so I selected the Opportunity in the Object field.

In Configure Trigger, I have selected A Record is Updated because when we Update the opportunity stage to “Close Lost” the record, the flow should trigger.

How to Delete Record in Salesforce Flow

5. Then, we have to Set Entry Conditions, and in the Condition Requirement option, we have to select All Conditions Are Met(AND) because the following condition should meet the criteria.

Our triggering condition is when StageName is equal to “Close Lost.” Then, the trigger should fire.

Then we need to select Every time a record is updated and meets the cond