How do fuzzy matching algorithms function within Sales Cloud duplicate rules to detect duplicates?
Answer
Basics: Exact matching compares values character for character. Fuzzy matching tolerates typos, nicknames, abbreviations and formatting differences, so "Bob Smith" and "Robert Smythe" or "Acme Inc." and "ACME Incorporated" can match. Salesforce ships standard matching rules for Account, Contact and Lead and lets you create custom ones.
How it works:
- Matching rule: choose the object and define a matching equation made of field comparisons with Exact or Fuzzy methods (fuzzy options exist for name, company, street and similar fields; verify which fields support fuzzy).
- Duplicate rule: link one to three matching rules, set conditions, and actions on create and on edit: Allow with alert, Allow with report, or Block; optionally limit by user or profile.
- When a record is saved, Salesforce evaluates the matching rule against existing records and applies the action.
- Matches are recorded in Duplicate Record Sets and Items for reporting; Duplicate Jobs scan existing data (higher editions).
- Users merge duplicates (up to three records at a time).
Advanced / deep dive: Fuzzy algorithms combine techniques such as nickname libraries, phonetic and edit-distance logic, so they raise recall at the cost of false positives; test with real data and tune the equation. Blank fields can influence results depending on rule settings. Limits include up to five active duplicate rules per object (verify current numbers). Rules run on UI, API and import, but you can bypass with DMLOptions.DuplicateRuleHeader.allowSave. Cross-object matching (Lead to Contact) is supported through standard rules. Large volumes of cleaned data are better handled by dedicated tools or Data Cloud identity resolution.
Code / config example:
List<Lead> candidates = <Lead>{ (FirstName=, LastName=, Company=) };
List<Datacloud.FindDuplicatesResult> results = Datacloud.FindDuplicates.findDuplicates(candidates);
(Datacloud.FindDuplicatesResult r : results)
(Datacloud.DuplicateResult d : r.getDuplicateResults())
(Datacloud.MatchResult m : d.getMatchResults())
System.debug(m.getRule() + + m.getSize());