Looking for some bright minds who maybe see a workaround for my problem:

We want to use the standard matching rules to identify potential duplicate contacts. An issue that keeps coming back is: we want to match records with filled in value vs empty value. Example:

  • FirstName "Robin" and FirstName "Robin" should match
  • FirstName "Robin" and FirstName "George" should not match
  • FirstName "Robin" and FirstName empty should match

The last point does not seem possible using matching rules, since setting "Match Blank Fields" to true will only allow for:

  • FirstName empty and FirstName empty should match

The only way to do this I see, is leave FirstName out of the matching criteria as a whole (thus the returned duplicate record set will contain too many items) and then later on fire some apex magic that deletes duplicate record items with filled in but different first names.

Is there any option I missed?

  • So you want A==B||(A!=''&&B=='')||(A==''&&B!='') as a match
    – Gilhil
    Apr 10, 2018 at 14:46
  • @Gilhil exactly Apr 10, 2018 at 14:48

1 Answer 1


What if you split the Two Situations. In the duplicate rule you can set conditions for the record that is being edited or created. Scenario 1. the record is not empty (use your matching rules) Scenario 2. the record is empty (use your matching rules without the FirstName rule)

So For Scenario 1 set as Condition Name to be not Empty. And for Scenario 2 Name to be empty. Then as Matching rule for Scenario 1 includes exact matching on Name. The Matching rule for Scenario 2 will not include exact matching on Name but the condition for Name to be empty.

              | Record 1  | Record 2

   Scenario 1 | Robin     | Robin
   Scenario 2 | Robin     | Empty
   Scenario 2 | Empty     | Empty 
   No Match   | Robin     | George
   No Match   | Empty     | Robin

Record 2 is the one you would edit, create in this case

UI Salesforce

  • What does that accomplish? Rule 1 will find FirstName "Robin" and FirstName "Robin". Rule 2 will find FirstName empty and FirstName empty => not even needed since I can just use "Match Blank Fields". Neither one of the rules will find FirstName "Robin" and FirstName empty which is what I am looking for. Apr 11, 2018 at 8:43
  • I've edited the Original Answer should be more clear what I mean now Apr 11, 2018 at 14:43
  • Ok, I see where you want to go. I'd have to test, but still that would not cover the last line. We don't care which record is 1 or 2, one of them having a first name and the other not should result in a match. Apr 12, 2018 at 7:56
  • If you edit/create the matching record with the name on it, it will indeed not be matched correctly : /. That might cause problems. Apr 13, 2018 at 8:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .