Skip to content

Interactive· Salesforce

Rules Engine

Matching rules that read like sentences. Put them in priority order, switch them on and off, and test any record against them.

Rules EngineDemo · sample dataThe real one runs in Salesforce

Matching rules

These run top to bottom on every list you import. The first rule that matches decides what happens to a row.

Try this: Pick Dev Patel, then drag “Leads being worked” above “Standard dedupe”. Watch the result.

  1. Priority 1: Standard dedupe

    2 rules

    Catches the obvious repeats: a phone number or a name-and-company that already exists as a Lead.

    1. Phone matches an existing lead: When a phone number matches an existing Lead’s phone number, reject it as a duplicate.
      Sets the result for Marcus Reed
      Reject as duplicate
    2. Name and company match a lead: When the last name matches an existing Lead’s last name and the company matches an existing Lead’s company, flag it for someone to review.
      Also matches Marcus Reed
      Flag for review
  2. Priority 2: Protect our clients

    2 rules

    Flags any row whose phone or company already belongs to a customer, so you never re-market to one.

    1. Phone matches a client: When a phone number matches an existing Account’s phone number, flag it for someone to review.
      Flag for review
    2. Company looks like a client: When the company is at least 85% similar to an existing Account’s name, flag it for someone to review.
      Flag for review
  3. Priority 3: Already a contact

    2 rules

    Catches rows whose email or phone already exists as a Contact.

    1. Email matches a contact: When the email matches an existing Contact’s email, reject it as a duplicate.
      Reject as duplicate
    2. Phone matches a contact: When a phone number matches an existing Contact’s phone number, flag it for someone to review.
      Flag for review
  4. Priority 4: Leads being worked

    1 rule

    Flags a row that matches a Lead a rep has touched recently, so you don’t step on an active conversation.

    1. Phone matches a lead being worked: When a phone number matches an existing Lead’s phone number and the Lead’s last activity was within the last 30 days, flag it for someone to review.
      Also matches Marcus ReedStops later rules
      Flag for review
  5. Priority 5: Phone book checks

    2 rules

    Uses the numbers on file: rejects a row whose number is already verified, flags one marked do not call.

    1. Number is on file and verified: When a phone number matches an existing Lead’s number on file and the Lead’s number status is Verified, reject it as a duplicate.
      Reject as duplicate
    2. Number is flagged do not call: When a phone number matches an existing Lead’s number on file and the Lead’s number status is one of Do Not Call, Known Bad Number, flag it for someone to review.
      Flag for review

About This Piece

Duplicate-matching rules for a lead import, written by the people who know the business, not by developers.

  • Each rule reads like a sentence: “When a phone number matches an existing Lead’s phone number, reject it as a duplicate.”
  • Rules sit in rulesets that run in priority order. The first rule that matches decides what happens, and every match is kept so you can see why.
  • Phone numbers, emails and company names are cleaned up before they’re compared, so “Kim & Co Design” and “Kim and Co. Design” are the same company, and fuzzy matching catches near misses.
  • A rule can also look at the record it matched: only flag a lead that someone worked in the last 30 days, or a number marked do not call.

The real engine is Apex with a Lightning Web Component editor, configured with custom objects. This demo runs the same logic in your browser against a small made-up CRM.

Want one of these
built for your team?

Tell us what slows your people down. We’ll show you what we’d build, and how it would fit the systems you already run.