How to Bypass Duplicate Rules in Flow : Yumi Ibrahimzade
by: Yumi Ibrahimzade
blow post content copied from Salesforce Time
click here to view original post
**Summary of Duplicate Rules in Salesforce and How to Bypass Them** Duplicate rules in Salesforce are essential for keeping data organized and free from duplicates, such as leads, contacts, or accounts. They work by using matching criteria to identify potential duplicates and can either alert users or prevent the creation of duplicate records. However, in some automated processes, like using Flow, you might need a way to bypass these rules temporarily to avoid disruptions. **How to Temporarily Bypass Duplicate Rules in Flow:** 1. **Add Conditions:** You can modify duplicate rules to apply only to certain records. This allows you to create conditions that can help bypass the rules during a Flow. 2. **Use Custom Fields:** To bypass duplicate rules, you can use custom fields. One effective method is to create: - A **date/time field** populated with the current date/time during the Flow. - A **checkbox formula field** that returns "true" for a brief period. The formula `Bypass_Duplicate_Rules_Date_Time__c + (2/86400) >= NOW()` allows the checkbox to be true for 2 seconds, which helps in bypassing the duplicate rule. 3. **Manual vs. Automated Creation:** When records are created or updated through Flow, the duplicate rule can be bypassed. However, if someone tries to create the same record manually, the duplicate rule will still be enforced. This approach allows for flexibility in managing records while ensuring that data integrity is maintained. **Additional Context:** Bypassing duplicate rules should be done with caution to avoid creating data integrity issues. This method is particularly useful in scenarios where automation is crucial, but it’s important to ensure that the bypass is temporary. **Hashtags for SEO:** #Salesforce #DuplicateRules #DataManagement #SalesforceFlow #Automation #DataIntegrity #CRM #SalesforceTips #TechTutorials #SalesforceBestPractices
Duplicate rules in Salesforce help maintain clean and consistent data. They identify and block or alert users about potential duplicate records, such as leads, contacts, or accounts. These rules work based on matching criteria defined through matching rules. They can either allow or prevent the creation or update of duplicate records. While they are useful for keeping data clean, in some cases like automation through Flow, you may need to bypass them to avoid interruptions. Here is a workaround to bypass duplicate rules in Flow.
How to Temporarily Bypass Duplicate Rules
You can add conditions to duplicate rules to target records that meet certain criteria. This means you can also add a condition to bypass duplicate rules in Flow. To do this, you need to update a field on the record that helps skip the rule. However, you don’t want the record to be exempt from duplicate rules permanently, only during the Flow.
Unlike validation rule criteria, you cannot use the ISCHANGED() function in duplicate rule conditions. Therefore, you cannot simply bypass duplicate rules when a field is changed, as you can do to bypass validation rules. If you use an editable field like a checkbox, you’ll need to reset it later. That can re-trigger the duplicate rule and cause your Flow to fail. A better solution is to use a field that stops meeting the condition automatically after the Flow finishes. What kind of field can do that? A formula field!
Let’s assume you have a duplicate rule on the Lead object, and you want to allow creating or updating duplicate Lead records in a Flow. You can achieve this using two custom fields:
The first field can be a date/time field and you should populate it in your Flow with the current date/time.

This field will not be used directly in the duplicate rule. As mentioned before, you need a checkbox formula field that returns "true" for a very short time (so that it stops meeting the criteria shortly after). Here is the formula for the checkbox field:
Bypass_Duplicate_Rules_Date_Time__c + (2/86400) >= NOW()
2/86400 means 2 seconds.

When you create or update the Lead record using Flow, it will populate the field and therefore bypass the duplicate rule. However, if you manually create or update the record, the duplicate rule will fire and block you.

As you can see, the Flow has successfully created a duplicate Lead. However, if you try to create the same record manually, the duplicate rule will block you.

The post How to Bypass Duplicate Rules in Flow appeared first on Salesforce Time.
April 07, 2025 at 12:59AM
Click here for more details...
=============================
The original post is available in Salesforce Time by Yumi Ibrahimzade
this post has been published as it is through automation. Automation script brings all the top bloggers post under a single umbrella.
The purpose of this blog, Follow the top Salesforce bloggers and collect all blogs in a single place through automation.
============================

Post a Comment