Admin or Workspace Manager Rights Required
This feature is available for Admins and Workspace Managers. A Salesforce Admin may also be needed for the Salesforce-related steps.
This document provides an in-depth overview of the Duplicate Match Algorithm offered by Chili Piper and Salesforce, focusing on Deduplication (Lead-to-Lead, Lead-to-Contact, Contact-to-Lead, or Contact-to-Contact) matching operations.
It will guide you through harnessing Salesforce's standard Duplicate Rules and creating your own custom Matching Algorithms within the Salesforce environment. Through clear step-by-step instructions and illustrative examples, it will equip you with the necessary knowledge to configure and test Duplicate Rules for optimal use in Distro.
Table of Contents
Salesforce Matching Algorithm Setup for Deduplication
In this section, we will describe how to leverage the Standard Salesforce Matching Algorithm and how to create a custom Matching algorithm there. This is needed to build the logic within Chili Piper later.
Standard Duplicate Rule in Salesforce
Salesforce comes out of the box with some Standard Duplicate Rules that can be activated in the CRM. These standard algorithms are very powerful and can fit probably most of the use cases.
Here are some examples:
Let’s take a closer look at the “Standard Lead Duplicate Rule”:
This Duplicate Rule works on the Lead Object (here, anytime a new Lead is being created or edited), and it can identify Leads with Duplicate Leads or Contacts.
As you can see on this screenshot, it has two different Matching rules:
- “Fuzzy Contact Matching Rule”
- “Lead Email Matching Rule”
Depending on the criteria configured for each matching rule on each object, Salesforce can detect if a duplicate record exists already and flag it to the user to avoid creating a duplicate.
How to create a custom matching algorithm in Salesforce for Duplicate Match?
Create your Matching Rule
The first step is to create the matching rule. Access the Salesforce Setup, then click on “Matching Rules” and finally "New Rule":
Then, select the Object to which this matching rule applies:
Name your rule and define your matching criteria:
In this example, we want to either match through the exact Email Address: test@chilipiper.com = test@chilipiper.com
OR match through a combination of three different criteria:
- First Name is Exact => John = John
- Last Name is Exact => Doe = Doe
- Company Name is Fuzzy => Chili Piper ≈ Chili Piper Inc
You can see this Salesforce documentation here to learn more about how the Salesforce algorithm works with the Exact or Fuzzy Operator.
Review your rule, and once you are ready, click Save and Activate.
Create your Duplicate Rule
It’s now time to create your Duplicate rule in Salesforce to leverage the Matching Rule you have just created in the previous step.
Back in the Setup, click "Duplicate Rules" and then "New Rule".
Select the Object to which you want your Duplicate Rule to be applied. In our case, we will select the Lead Object.
Name your Duplicate Rule and select the object you want to compare with and the appropriate Matching rule. Note the Rule we created is selected in the "Matching Rule" dropdown, highlighted by the number three below:
Important
For Distro to listen to the Duplicate rule, the checkbox “Report” right next to "Actions On Create" must be checked:
Mix Matching Rules
Optionally, you can also add an additional Matching Rule. For example, if you also want to Compare Leads with Contacts. Click "Add Rule" as shown below:
Then select "Contacts" in the "Compare Leads With" and the Matching Rule you want to use in the "Matching Rule" field:
Your Duplicate Rule now combines two different Matching rules for Leads and Contacts!
In other words, whenever you create a new Lead Record, both Matching criteria on Lead and Contact will be applied to detect a possible Duplicate.
You can also take a look at the Mapping to see if everything is properly configured by clicking the "Mapping Selected" option:
Then, you will have a view like this to confirm if everything looks accurate:
Advanced: Enable Matching only for Distro
If you only want to leverage the Salesforce capabilities in Distro and not into the whole Salesforce instance, you can add this criteria to your Duplicate Rule:
In this use case, the integration user between CP and Distro is “Integration@chilipiper.com” so anytime a Matching is executed through this Duplicate Rule, it will only apply in Distro and not to the whole SFDC Instance.
Save and Test your Duplicate Rule
Ready? You can now Save and Activate your Duplicate Rule, activate it, and start testing:
Now, let’s go into Salesforce and create a Lead record:
We will now try to create a new lead with a different name but the same email address (Matching Rule #1):
You can see that Salesforce flagged the duplicate because of an EXACT email address between both records.
Now, let’s try to create a new lead with a different email address but with these conditions:
- First Name is Exact
- Last Name is Exact
- Company Name is Fuzzy
As you can see, Salesforce has detected that the Company Name is slightly different, while the First Name and Last Name are the same.
If the tests work as expected, it's time to move to Distro to finish the setup over there!
Chili Piper Setup
It's time to work on Chili Piper's setup to combine the Salesforce Rules we created previously with Distro!
Enable the Salesforce Matching in Distro
In the left-hand side menu, expand the "Settings" menu, and then click "Matching".
Then, click "Duplicate Match" in the page's header to start building your logic.
Below, select which logic you want to work with: Lead-to-Lead, Lead-to-Contact, Contact-to-Lead, or Contact-to-Contact, and ensure the selected ones are enabled.
If you are going to work with multiple, you will need to configure each logic under the proper tab and always double-check if they are all enabled.
Now, click the "Add Salesforce Duplicate Rule" and select the ones you want to add. The disabled ones should be inactive in Salesforce, so if you notice any greyed-out ones you want to activate, double-check them in Salesforce and ensure you activate them.
Add Filters & Tiebreakers
Optionally, you can add Filters to refine matches if the algorithm returns multiple records. Click "Add Filter", and build the rules you want to use to refine.
In the Lead-to-Lead example below, we included a filter to check if the existing Lead's Country is the same as the Incoming Lead's:
You can click on "Add Group" to create a group of rules that will be added to your conditions. You will also see a Sub-Group option that can only be created if you already have a Group. With this option, you can guarantee that multiple conditions will be checked in the same Rule, allowing you to create a complex scenario based on the fields you need to evaluate.
You must have at least one Tiebreaker that helps you select the conditions that are the priority for 'tiebreak' and find the best match according to your criteria.
The Tiebreaker will always follow the Matching record you are working with, so, for example, if you are working with Lead-to-Contact or Lead-to-Lead, the Tiebreaker will be Lead-based.
Click "Add Tie-break" to start including them.
In the example below, our Tiebreaker will be the Lead with the maximum created date, meaning if we still have multiple matches, we will select the most recent one.
If you are using multiple Tiebreakers, you can re-order them to tell Chili Piper the order we should prioritize them. If the first Tiebreaker is still not enough, we will move to the second one, and so on.
Add the "Duplicate Match" node to your Router's Flow
Under Distro in the left-hand side menu, navigate to "Router". Over there, you can create a new one or use an existing one to add this node.
The Duplicate Match node only works with Lead and Contact-related Triggers and must be included before a Routing Rule. You will not find the option to add it if your Trigger is different than Lead or Contact and after a Routing Rule node.
Ensuring your flow matches the above criteria, once it's opened, click the + sign where you want to add it, and select "Duplicate Match":
This action will include all Matchings you created in the previous steps associated with the Trigger's object. Working with the example below, notice how the Trigger is Lead-related, so the Contact-to-Contact and Contact-to-Lead don't appear.
It's a good opportunity to Reinforce and check if the Matchings you want to work with are enabled in the Matching settings.
If you want to work with only one Matching, you can click the one you want to remove and then select "Delete Node." Still, using our example, we want to work with only the Lead-to-Lead matching, so we will delete the Lead-to-Contact one.
By default, we will add the Assign & Update Ownership node after the Duplicate Match. Other Salesforce-related nodes and a Service Level Agreement (SLA) will be available to be included in the flow:
Check this article to learn more about these nodes and SLAs.
Merge Records
Optionally, you can also choose to merge records when the Duplicate Matching occurs for the same type of record: Lead to Lead or Contact to Contact.
To merge records, click the "+" in a Lead to Lead or Contact to Contact path, and select "Merge Records":
Once the node is created, you will find some options to adjust.
Select which Record to Keep
Here, you can select whether to Keep the Existing Lead Record or the incoming one.
Overwrite Fields
After selecting the behavior associated with which record to keep, as shown above, this setting will be enabled so you can select between the options below:
-
Always Replace Values: This option will always replace the values in the master record with values from the other record. If the master record is the existing record, it will keep its values.
-
Replace Blank Fields Only: This option will only replace blank fields in the master record with values from the other record, preserving existing values in the master record. If the master record is the existing record, it will keep its values.
- Replace Non-Blank Fields Only: This option will replace the values in the master record with values from the other record, as long as those values are not blank. This prevents blanking out existing values in the master record if they are already populated. If the master record is the existing record, it will keep its values.
Once done with your configuration, don't forget to Publish your Router!