# Protect External IDs When You Merge CRM Duplicates | Dedupely

> Keep ERP, billing and contract IDs safe when you merge: match on the ID, review records with different IDs, and choose which record survives.

- URL: https://dedupe.ly/knowledge-base/protecting-external-ids-when-you-merge
- Section: knowledge-base
- Site index: https://dedupe.ly/llms.txt
- Any page: append `.md` to its URL for this plain-text form

---

Skip to content
[New Dedupely Intelligence Now on every paid plan, monthly or yearly.](https://dedupe.ly/ai-deduplication)

## Protecting External IDs When You Merge

By
[Gaby Salinas](https://www.linkedin.com/in/gbyslns)
Updated November 11, 2026
Keep ERP, billing and contract IDs safe: merge the duplicates that share an ID, and never the records that have different ones.
External IDs, like an ERP Customer Number, a Tax ID or a billing account number, link a CRM record to another system. Two records with the same external ID are almost always duplicates. Two records with different IDs are almost always different customers, even when their names and emails look alike, and merging them leaves one ID behind. In Dedupely, you protect external IDs by matching on them, finding the matches where they differ before you merge, choosing which record survives with Merge Rules, and, in Dedupely Intelligence, using Protected fields.

### Before you start

- **A connected and synced CRM**, with the ID fields synced. All fields are synced to Dedupely, including custom fields. See [Connect your CRM](https://dedupe.ly/knowledge-base/connect-your-crm).
- **Know which fields hold external IDs**, and whether they're read-only in your CRM. Merge Rules can't be set on read-only fields.

### What can go wrong with external IDs

| **Situation** | **Example** | **What to do** |
| --- | --- | --- |
| **Same ID** | Two accounts with ERP Customer Number 10442 | A strong duplicate. Match on the ID with **Exact**. |
| **One record has the ID, the other is blank** | A contact from a web form, and the same person synced from billing | Usually a duplicate. Make sure the record with the ID survives (see below). |
| **Different IDs** | Two branches of the same company, each with its own Tax ID | Usually different customers. Don't merge them: find these matches and reject them. |

### Step 1: Match on the ID itself

Create a Duplicate Search on the ID field with **Exact**, plus one or two fields to confirm the match, like Company Name and Website (Domain Root). Records that share an external ID are your safest duplicates. See [Duplicate Searches](https://dedupe.ly/knowledge-base/duplicate-searches).
Because a wrong merge here can affect billing or an ERP sync, start with [Auto Match](https://dedupe.ly/knowledge-base/auto-match) and send unclear matches to [Manual Review](https://dedupe.ly/knowledge-base/manual-review) for the account owner, instead of merging everything at once.

### Step 2: Find the matches where the IDs differ

Your other searches, on name, email or domain, can still put two records with different IDs in the same match. Find them before you merge:
- Open the Duplicate Search and click **Filters**.
- Click **+ Add condition** and select the ID field.
- Choose the operator **is unique across match**. It shows the matches where every record has a different value.
- Leave **Count blanks as a value** unchecked, unless you want a blank ID to count as its own value.
- Click **Done**, then **Scan**.
Review what's left. Reject the matches that aren't duplicates, so they never come back in any search for that object, and send the unclear ones to Manual Review. See [Filters](https://dedupe.ly/knowledge-base/filters) and [Rejected Matches](https://dedupe.ly/knowledge-base/rejected-matches).

### Step 3: Make sure the record with the ID survives

Blank values never overwrite existing data, so when only one record in a match has the ID, the ID is kept. What you choose is which record survives, with its record ID and its link to your other system:
- **Primary Record:** set it to **Custom**, with a Win Rule: When Field your ID field, operator **is not blank**. The record linked to your ERP or billing system is the one that's kept.
- **The ID field:** set it to **Only Primary**, so the surviving record keeps its own ID.
- **Check the result** in the **Merge Preview**
column of View Match Details before you merge in bulk.
How each CRM handles the record ID on a merge:
- **Salesforce:** the master record keeps its ID, so integrations that point to it keep working.
- **HubSpot:** HubSpot gives the merged record a new Record ID, and the old IDs redirect to it. If another tool stores HubSpot IDs, update them over time.
See [Merge Rules](https://dedupe.ly/knowledge-base/merge-rules).

### Step 4: In Dedupely Intelligence, use Protected fields

Dedupely Intelligence doesn't use your Duplicate Searches' match settings or filters. To keep records with different external IDs from matching there, use Protected fields:
- Open **Dedupely Intelligence** under Contacts, Companies or Leads.
- Click **Protected fields** at the top right.
- Under **Never match values on differing fields**, click **Add a field** and choose your ID field. You can add up to 5 fields.
- Choose how blank values are treated:
- **None can be blank:** records only match if every record has the ID, and it's the same.
- **At least one must not be blank:** a record without the ID can still match one that has it.
- **All can be blank:** blank IDs never keep records from matching; only different IDs do.
- Click **Save**.
If many of your records don't have the ID yet, like contacts from web forms, choose **All can be blank**, so they can still match. The other two options are stricter. See [Protected Fields](https://dedupe.ly/knowledge-base/protected-fields).

### Step 5: Keep it safe over time

- **Automate last.** Turn on Auto Merge only on the search that matches on the ID itself, once it has run without false matches. Keep searches on names or domains on Auto Match.
- **Keep your Safety Settings on.** They set aside matches built on placeholder data, and matches with more than 20 records, which usually mean a shared or placeholder value. See [Merge Safety](https://dedupe.ly/knowledge-base/merge-safety).
- **If two records with different IDs were merged**, undo the merge from Merge History within 30 days. The records come back with new IDs, so check the links your other systems have to them. See [Undo a Merge](https://dedupe.ly/knowledge-base/undo-a-merge).

### Example setup

A distributor syncs its ERP into Salesforce. Each account has an **ERP Customer Number**, and branches of the same company have their own numbers.
- **Search 1 (same ID):** ERP Customer Number: Exact · Account Name: Similar Words (Any Order), with Ignored terms *Inc.*,
*LLC*, *Ltd.* · On Auto Match, then Auto Merge once it has run without false matches.
- **Search 2 (by name):** Account Name: Similar Words (Any Order) · Website: Domain Root · Billing City: Exact. Filter: ERP Customer Number · is unique across match. The team reviews these matches every week and rejects the branches.
- **Merge Rules:** Primary Record set to Custom, with a Win Rule: When Field ERP Customer Number · is not blank. ERP Customer Number set to Only Primary.
- **Dedupely Intelligence:** ERP Customer Number added to Protected fields. Accounts created by the sales team don't have a number yet, so the blank option is **All can be blank**.

### Common mistakes

- **Merging on name alone when records have IDs.** Two branches with the same name are different customers. Check the ID first.
- **Merging the "is unique across match" results in bulk.** Those are the matches where the IDs differ. Review them one by one.
- **Letting the record without the ID survive.** Set the Primary Record so the record linked to your other system wins.
- **Turning on Auto Merge on a search that doesn't include the ID.** Keep it on Auto Match, and review.
- **Forgetting Dedupely Intelligence.** Its matches don't use your filters. Add the ID to Protected fields.

### FAQs about external IDs

- **Are two records with the same external ID always duplicates?** Almost always. Watch for placeholder values, like 0000, that many records share. Safety Settings set aside matches with more than 20 records.
- **What happens to the ID when one record has it and the other doesn't?** Blank values never overwrite existing data, so the ID is kept.
- **What if both records have different IDs?** Don't merge them. Use the "is unique across match" filter to find these matches, and reject them.
- **Can Merge Rules change a read-only ID field?** No. Merge Rules can't be set on read-only fields.
- **Do Protected fields work in my own Duplicate Searches?** No. They're for Dedupely Intelligence. In your own searches, match on the ID and use filters.
- **Can I undo a merge of two records with different IDs?** Yes, within 30 days, from Merge History. The restored record gets a new ID in your CRM.

### Next up

[Protected Fields Keep records from matching in Dedupely Intelligence when a field that should never change is different.](https://dedupe.ly/knowledge-base/protected-fields)

### Still stuck?

Our team helps on every plan and during the free trial, by chat, email or Zoom.
- Need help? [Talk to support](https://dedupe.ly/contact)
- Questions about plans? [Book a Zoom with sales](https://meetings.dedupe.ly/meetings/gaby-salinas/kb-zoom-scheduler)
- Reading this with a model? [Read this page as Markdown](https://dedupe.ly/knowledge-base/protecting-external-ids-when-you-merge.md)
- Feeding it the whole site? [Read llms.txt](https://dedupe.ly/llms.txt)
Behind the article

### Gaby Salinas

Marketing Assistant at Dedupely
Gaby Salinas came to CRM data from marketing and advertising, so she looks at duplicates from two sides: the match and merge logic behind them, and what they do to the people using the CRM, like the rep who calls a customer twice, the admin who gets blamed and the cleanup nobody wants to start.
As Marketing Assistant at Dedupely, she follows how RevOps teams, end users, consultants and technical teams actually work with their data: the records they stop trusting, the workarounds they build and the moment they finally decide to clean up. What she finds shapes most of what Dedupely publishes.
[Connect with Gaby on LinkedIn](https://www.linkedin.com/in/gbyslns)

### Get started for free

20 free trial merges and as much free support as you need to get your duplicates under control.
[Try for free](https://v2.app.dedupe.ly/signup)[Talk to sales](https://meetings.dedupe.ly/meetings/gaby-salinas/talk-to-sales)
[Or sign up with Google](https://v2.app.dedupe.ly/signup/google)
Running CRM cleanup for clients? [See the Partner Program](https://dedupe.ly/become-a-partner)
