Bad data will always exist on your system. Do not pretend otherwise. 

As administrators, we have some powerful tools at our disposal that can help us overcome bad data. For example, we can use validation rules to verify that data entered by users meets certain specifications. 

We can also use Duplicate Management to increase confidence in our system data by resolving and preventing our users entering duplicate records. Duplicate records can cause all sorts of problems. For example, imagine you are calling a customer and you are looking at your record for the customer but someone else is also calling the customer and using another record to log information, then you might appear a little disorganised. 

Salesforce has Duplicate Rules and Matching Rules to help us handle and avoid duplicates. Simply put, the matching rule will define the criteria used to identify duplicates and the duplicate rules will determine what action happens when a duplicate is encountered. 

Note that Salesforce comes with some standard matching rules. You can see the details of the standard rules here.

Creating a new Rule

Okay, lets imagine that we want to create our own matching rules for contacts and, more specifically, we want to match based on first name, last name and email address.

To get started, navigate to ‘Setup’ and search for ‘Matching Rules.’ 

Click on ‘Matching Rules’ and then press the ‘New Rule’ button. 

Next, we need to specify which object our matching rule applies to. In our case, we will select ‘Contact’ and press ‘Next.’ 

Then we need to provide our rule with a name and, optionally, a description.

Whilst the description is optional, we recommend that you enter some information here so that the rest of your team and any future admins have some context on the rule. 

The next section is ‘Matching Criteria.’ It is within this section that we need to tell the rule which fields to compare for matching and in what manner. 

In our case, we will enter the criteria as follows: –

The ‘Matching Method’ determines the logic used to compare the field. An exact match is looking for an exact match and a ‘fuzzy’ match is looking at strings that match a pattern. You can find more information about how the logic is defined here.

In our example above, we are looking for an exact match on the last name and email and a fuzzy match on first name. 

Now that we have defined the rule details and the matching criteria, we can press the ‘Save’ button. 

When you save the rule, you will see the rule details, with some options to edit, clone, delete and activate the rule. 

Note that the rule is not active by default. 

Before we do anything further, press the ‘Activate’ button so that we can use this rule in the next step.

The next step is creating the duplicate rule. The duplicate rule will work together with the matching rule that you have just created to tell Salesforce what action to take if a duplicate has been identified. 

Search ‘Setup’ for ‘Duplicate Rules’ and press ‘New Rule’ and then select ‘Contact.’ 

First, provide the rule with a name, write a description, and then specify if you want the rule to use or ignore record level security.

Then specify what happens when a user tries to save a record identified as a duplicate.

In the example above, you will see that the action from the system will be to warn / alert the user to the fact that they are potentially creating a duplicate. 

Finally, define how the duplicate records are identified by specifying what you are comparing against (in this case, contacts to contacts) and which matching rule to use (the one we created earlier!).

Then press ‘Save’ at the bottom of the screen. 

Your custom contact duplicate rule is now ready to use and all you need to do is press the ‘Activate’ button to activate it. 

Kevin Paul is Head of Professional Services at Ribbonfish. He has over a decade worth of experience in Information Technology in a variety of roles including consulting & implementation, training, business analysis and project management.

Looking for more Salesforce insider knowledge?

Sign up to our newsletter

Photo by Valeria Miller