Matching Rule Examples

Review these examples to understand how records are compared and evaluated as duplicates.

Required Editions

Available in: Lightning Experience and Salesforce Classic
Available in: Essentials, Professional, Enterprise, Performance, Unlimited, and Developer Editions
Custom Lead Matching Rule with Fuzzy Matching Methods
Custom Lead Matching Rule with Fuzzy Matching Methods
Matching Criteria
  Field Matching Method
1 Company Fuzzy: Company Name
2 Email Exact
3 Phone Fuzzy: Phone
  Matching equation is (Company OR Email) AND (Phone)

Based on these matching criteria, here’s how matching works.

  1. Match key values are generated for existing leads. Based on the matching equation and the specified matching methods, two match keys are created. From these keys, match key values are generated.
    Match Keys
    Matching Equation in Standardized Format Match Key Sample Matching Field Values Sample Match Key Values
    (Company AND Phone) OR Company (2,6) Phone

    Company = Elite Sport

    Phone = 415-555-1234

    elitesport415555
    (Email AND Phone) Email Phone

    Email = john.doe@elitesport.com

    Phone = 415-555-1234

    john.doe@elitesport.com415555
  2. Match key values for the new record are generated. The values are generated when the new record is saved.
    New Record
    Matching Field Values Match Key Values

    Company = Elite Sports

    Email = john.doe@elitesport.com

    Phone = 1-415-555-1234

    elitesport415555

    john.doe@elitesport.com415555

  3. Match key values for the new record are compared with values from existing records.
    Existing Records Compared with New Record
    Record Matching Field Values Match Key Values Match?
    1

    Company = Elite Sports

    Email = john.doe@elitesports.com

    Phone = 1-415-555-1234

    elitesports415555

    john.doe@elitesports.com415555

    No. Not considered a duplicate.
    2

    Company = Elite Sport

    Email = john.doe@elitesport.com

    Phone = 1-415-555-1234

    elitesport415555

    john.doe@elitesport.com415555

    Yes. The first match key values don’t match. However, the second match key values are identical, so the record is considered a potential duplicate. Only one match key value match is needed.
  4. Determine if the new record is a potential duplicate. Does the new record have the same match key value as an existing record?
    • Yes, the new record is considered a potential duplicate. It’s evaluated further using other matching resources, including matching algorithms.
    • No, the new record isn’t considered a duplicate.
Custom Contact Matching Rule with Exact Matching Methods
Custom Contact Matching Rule with Exact Matching Methods
Matching Criteria
  Field Matching Method
1 City Exact
2 Email Exact
3 Phone Exact
  Matching equation is (City OR Email) AND (Phone)

Based on these matching criteria, here’s how matching works.

  1. Match key values are generated for existing contacts. Based on the matching equation and the specified matching methods, two match keys are created. From these keys, match key values are generated.
    Match Key
    Matching Equation in Standardized Format Match Key Sample Matching Field Values Sample Match Key Values
    (City AND Email) OR City Email

    City = San Francisco

    Email = john.doe@elitesports.com

    sanfranciscojohn.doe@elitesports.com
    (City AND Phone) City Phone

    City = San Francisco

    Phone = 415-555-1234

    sanfrancisco4155551234
  2. Match key values for the new record are generated. The values are generated when the new record is saved.
    New Record
    Matching Field Values Match Key Values

    City = San Francisco

    Email = john.doe@elitesports.com

    Phone = 415-555-1234

    sanfranciscojohn.doe@elitesports.com

    sanfrancisco4155551234

  3. Match key values for the new record are compared with values from existing records.
    Existing Records Compared with New Record
    Record Matching Field Values Match Key Values Match?
    1

    City = San Francisco

    Email = john.doe@elitesports.com

    Phone = 1-415-555-1234

    sanfranciscojohn.doe@elitesports.comsanfrancisco4155551234 No. Not considered a duplicate.
    2

    City = San Francisco

    Email = john.doe@elitesports.com

    Phone = 1-415-555-1111

    sanfranciscojohn.doe@elitesports.com

    sanfrancisco4155551234

    Yes. The first match key values are identical, so the record is considered a potential duplicate. Only one match key value match is needed.
  4. Determine if the new record is a potential duplicate. Does the new record have the same match key value as an existing record?
    • Yes—The new record is considered a potential duplicate. It’s evaluated further using other matching resources, including matching algorithms.
    • No—The new record is not considered a duplicate.

Although this matching rule is within the field limit, it exceeds the row limit of 10 when written in the standardized format. Therefore, it can’t be saved. Refine the matching rule so that it uses fewer OR operators within groupings.

Example
Example You get an error that your matching rule uses too many OR operators within groupings. The error is generated because a matching rule has a limit of 10 fields arranged into an equation. When a matching rule is saved, the equation is rewritten into a standardized format that translates the OR statements to AND statements. The standardized format has a limit of 10 rows.

Suppose that your matching rule includes the following equation.

(Field 1 OR Field 2) AND

(Field 3 OR Field 4) AND

(Field 5 OR Field 6) AND

(Field 7 OR Field 8)

It’s rewritten as follows. Although this matching rule is within the field limit, it exceeds the row limit of 10 when written in the standardized format. Therefore, it can’t be saved. Refine the matching rule so that it uses fewer OR operators within groupings.

(Field 1 AND Field 3 AND Field 5 Field AND 7) OR

(Field 1 AND Field 3 AND Field 5 AND Field 8) OR

(Field 1 AND Field 3 AND Field 6 AND Field 7) OR

(Field 1 AND Field 3 AND Field 6 AND Field 8) OR

(Field 1 AND Field 4 AND Field 5 AND Field 7) OR

(Field 1 AND Field 4 AND Field 5 AND Field 8) OR

(Field 1 AND Field 4 AND Field 6 AND Field 7) OR

(Field 1 AND Field 4 AND Field 6 AND Field 8) OR

(Field 2 AND Field 3 AND Field 5 AND Field 7) OR

(Field 2 AND Field 3 AND Field 5 AND Field 8) OR

(Field 2 AND Field 3 AND Field 6 AND Field 7) OR

(Field 2 AND Field 3 AND Field 6 AND Field 8)OR

(Field 2 AND Field 4 AND Field 5 AND Field 7) OR

(Field 2 AND Field 4 AND Field 5 AND Field 8) OR

(Field 2 AND Field 4 AND Field 6 AND Field 7) OR

(Field 2 AND Field 4 AND Field 6 AND Field 8)