In Salesforce Flow, when we create a record using screen flow, we can check whether this record is already created and display the message for the same.
In this Salesforce tutorial, we are going to learn about Check Duplicate Records Using Screen Flow in Salesforce. We will create a screen flow to check whether the record we will create is already present. If the record is present, then display the error message.
What is the Duplicate Rule in Salesforce?
In Salesforce, a Duplicate Rule can block users from saving records that have been identified as possible duplicates or simply alert users that they may be creating a duplicate record but allow them to save the record anyway.
You can read the whole article on Different Ways to Prevent Duplicates in Salesforce.
How to Check Duplicate Records Using Screen Flow
Scenario:
While working as a Salesforce administrator, I was assigned a task to create a screen flow where we can apply duplicate rules to block users from creating duplicate Lead records and display the error message that the record you are creating already exists or is duplicated.
Using the above scenario and the following steps, we can check duplicate records using screen flow.
Create Screen Flow:
1. Click on the Setup -> Home Tab -> In Quick Find Box, Search for Flows. You will see an option under Process Automation -> Click on Flows.
- Then, click on the New Flow button to create a new flow.
- Here, we will use Screen Flow to create a duplicate record and check whether it displays an error message. To do that, create a flow with the Screen Flow component, click on it, and then click on the Create button.
Screen Element:
2. Now, we have to add a Screen to the Canvas. To do that, click on the Elements tab from the Toolbox. You will see the Screen element under the Interaction drag and drop screen component on Canvas.
- Then, enter the Label and API Name into the Screen Component.
- Now, we need to create some fields. Here, I have created the following fields that are required in the Lead object with the Label, and the API Name will automatically populate them.
- Last Name, Email, Company, and Lead Status.

Assignment Element:
3. To assign values to lead object fields, we need to fetch Leads object fields. For that, click on Add New Resource and enter the following details:
- Resource Type: Variable.
- API Name: var_Lead.
- Data Type: Record( Because we are fetching Lead record fields).
- Object: Lead.