Matching Rules
Matching Rules are the Salesforce configuration that defines how the platform compares records to identify duplicates.
Definition
Matching Rules are the Salesforce configuration that defines how the platform compares records to identify duplicates. Each Matching Rule specifies which fields to compare and which comparison method to use per field: exact match, fuzzy match, or specific algorithms for normalized comparison of names, companies, emails, or addresses. The rule is the lower-level building block of Duplicate Management; Duplicate Rules reference Matching Rules and decide what to do when a match is found.
Standard Matching Rules ship for Account, Contact, and Lead, with pre-built logic appropriate for B2B sales scenarios. Custom objects need administrator-created Matching Rules. A single Matching Rule can be cross-object, allowing a Lead to match against existing Contacts, which is the foundation of the Lead-to-Contact duplicate detection most B2B orgs need. Each object can have up to 5 active Matching Rules; activating a rule takes several minutes and queues other operations on the rule during the activation window.
How Matching Rules compare records
Matching methods per field
Each field in a Matching Rule has a comparison method. Exact: values must be identical. Fuzzy: tolerates minor differences (typos, slight spelling variations). Specialized: Company Name, Person Name, Email, Address have algorithms that handle common variations (Inc vs Incorporated, Bob vs Robert, etc.). Choose the method per field based on the data quality and the tolerance for false positives.
Multi-field rules
Matching Rules typically combine multiple fields. A common Lead-to-Contact rule matches on Email exact OR (Last Name exact AND Company Name fuzzy). Multi-field logic uses Match Equation syntax (numbered fields with AND/OR operators). Build the equation carefully; small changes affect the false-positive rate substantially.
Cross-object Matching Rules
Matching Rules can compare records across objects. The standard Lead-to-Contact and Lead-to-Account rules exist out of the box. Custom cross-object rules need careful field mapping; the fields being compared must exist semantically on both objects (Email on Lead and Contact is straightforward; matching Lead Company to Account Name is the standard).
Activation and queue
Activating a Matching Rule takes several minutes. The platform builds the matching index in the background. During activation, other operations on the rule are queued. Plan activations for off-peak hours to avoid user disruption. Once active, the rule is available for Duplicate Rules and Duplicate Jobs to reference.
Bypass Sharing Rules option
The Bypass Sharing Rules option lets the matching engine see records the running user cannot. Required for steward roles needing org-wide duplicate visibility. Risky for standard users: they may be told a duplicate exists but cannot view or merge it. Use for steward profiles only.
Performance considerations
Matching runs synchronously on save (for real-time Duplicate Rules) or asynchronously (for batch Duplicate Jobs). High-cardinality matching (matching on a high-volume field) can slow saves noticeably. Limit fields used in matching to those that genuinely identify duplicates; do not include every possible matching field "just in case."
5-rule cap per object
Each object caps at 5 active Matching Rules. Plan rule design tightly; one well-tuned cross-object rule beats five overlapping single-field rules. Hitting the cap usually indicates rule design needs consolidation rather than more rules.
Build a Matching Rule for duplicate detection
Building a Matching Rule combines business logic decisions (what makes a duplicate) with technical configuration. The steps below cover the standard workflow.
- Decide what makes a duplicate
Work with business stakeholders. List the fields that identify a unique record (Email, Phone, Company + Name combination). Decide tolerance for false positives.
- Open Matching Rules
Setup > Matching Rules > New Rule. Choose the object.
- Add fields to compare
For each identifying field, add a row with the field and matching method. Use specialized methods where applicable; Fuzzy as fallback for unstructured text.
- Define the Match Equation
Build the AND/OR logic. Number the fields, then write the equation: 1 OR (2 AND 3). Test mentally against sample records.
- Decide on Bypass Sharing Rules
Enable only for steward profile use cases. Leave off for standard rules.
- Save and activate
Activation takes a few minutes. Wait for completion before referencing in Duplicate Rules.
- Test with known duplicates
Insert known duplicate records manually. Confirm the rule fires; adjust if false positives or false negatives appear.
Values must be identical. Strictest method.
Tolerates minor variation. General-purpose fallback.
Handles Inc/Incorporated, LLC/Limited, etc.
Handles nicknames and common variants.
Match against records on a different object. Lead-to-Contact is the standard example.
- Each object caps at 5 active Matching Rules. Plan tightly; overlapping rules produce noise.
- Activation takes minutes and queues other operations. Plan rule changes for off-peak.
- Bypass Sharing Rules combined with standard user profiles produces bad UX. Reserve for steward profiles.
- High-cardinality field matching can slow saves. Limit fields to those that genuinely identify duplicates.
- Cross-object rules require fields to exist semantically on both objects. Field-mapping mistakes produce silent match failures.
Trust & references
Straight from the source - Salesforce's reference material on Matching Rules.
- Things to Know About Matching RulesSalesforce Help
- Things to Know Before You Customize Matching RulesSalesforce Help
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. In which area of Salesforce would you typically find Matching Rules?
Q2. Why is understanding Matching Rules important for Salesforce admins?
Q3. Can a Salesforce admin configure Matching Rules without writing code?
Discussion
Loading discussion…