How to Merge Duplicates across HubSpot and Salesforce While the Sync Is Active
Your sales team is using both HubSpot and Salesforce and is running into duplicate records in one CRM or the other, and sometimes in both.
You have a data sync set up between the two systems, but don't know how to deduplicate effectively to ensure a consistent cleanup effort across CRMs. In addition, HubSpot doesn't allow you to deduplicate companies while the sync is active from within the HubSpot app.
With Insycle's Merge Duplicates module, you can bulk merge duplicate people and companies automatically, including through HubSpot workflows and Salesforce Flows, while the HubSpot-Salesforce sync is active. Additionally, you can manage the merge process by setting rules for selecting the master record and determining the values to keep. For instance, you might choose to retain the owner from the contact that was created first.
Before You Start: Two Setup Steps That Keep Both CRMs in Sync
Because HubSpot and Salesforce are connected, a merge in one platform can affect records in the other. Before running any merge operations, two things need to be in place: one deletion behavior setting in HubSpot and one custom field in both CRMs. Together, they ensure that both platforms merge into the same master record and that no records are unintentionally removed during the process.
- Set HubSpot's deletion behavior to "Do nothing" — This ensures that when a Salesforce record is merged away, the corresponding HubSpot record is not automatically deleted. It will remain in HubSpot as an unlinked record and will need to be cleaned up separately after the merge. This is covered in Step 1.
- Create the Deduplication Master Record field in both CRMs — Because Salesforce lacks a native field indicating which record is actively synchronizing with HubSpot, this custom field provides that visibility. Insycle stamps it on the master record after the Salesforce merge and uses it to align master selection during the HubSpot merge. This is covered in Step 2.
An alternative to the custom field approach is also available and documented at the end of this article. See Alternative: Create a HubSpot ID Field in Salesforce.
Process Summary
- Set HubSpot's deletion behavior to "Do nothing" before any merge operations.
- Create the Deduplication Master Record field in both CRMs and configure the property mapping.
- Merge duplicates first in Salesforce using Insycle, which automatically stamps the master record.
- Before running the HubSpot merge, run an incremental Insycle sync on the HubSpot database to ensure the Deduplication Master Record value has propagated.
- Merge duplicates in HubSpot using the Deduplication Master Record field to select the master.
Step-by-Step Instructions
1. Required HubSpot-Salesforce Sync Setting
Before merging any duplicate records in Salesforce, you must verify one critical setting in HubSpot. If this setting is not configured correctly, merging records in Salesforce will send the corresponding HubSpot records to the recycle bin, which may be difficult to fully restore.
In HubSpot, the deletion behavior setting controls what happens to a HubSpot record when its linked Salesforce record is deleted or merged. When you merge duplicate records in Salesforce, the records being merged into the master are deleted. If HubSpot is set to mirror that deletion, those HubSpot records will be moved to the recycle bin automatically — even though you intentionally merged them, not deleted them.
To prevent this, the HubSpot deletion behavior for all synced object types must be set to "Do nothing" before you begin.
In HubSpot, navigate to Settings > Integrations > Connected Apps.
-
Locate Salesforce, then click the Actions button and select Go to settings.
On the app settings page, click the Data sync tab.
Select the object type from the menu on the left.
-
To ensure that HubSpot duplicates are not automatically deleted when you merge in Salesforce, under Deleting [Objects], verify that the following settings are in place for each synced object type you plan to deduplicate:
- When a Salesforce [contact] is deleted → Do nothing in HubSpot
- When a Salesforce [lead] is deleted → Do nothing in HubSpot
Important: Do not proceed with merging any Salesforce records while the HubSpot sync is active until you have confirmed these settings. This applies whether you are running a manual or automated merge.
Note: After completing the Salesforce merge, any HubSpot records whose Salesforce counterparts were merged away will remain in HubSpot as unlinked records — they will not be automatically removed. You will need to clean these up separately. This is expected behavior when the deletion setting is "Do nothing," and it is preferable to the alternative of records being sent to the recycle bin unintentionally.
2. Create Custom Fields in Your CRMs to Tag the Master Record
To label records that are deemed the master for each set of duplicates, you'll need to create a custom field in both platforms. In each CRM, HubSpot and Salesforce, add a custom field named “Deduplication Master Record.” This needs to be added to any synced object type that you plan to deduplicate.
Insycle will automatically populate this field with the correct value. To prevent users from accidentally changing its value, you may want to hide this field from the default layout or make it non-editable from the view.
Add the Custom Field in Salesforce for Each Object Type
In Salesforce, navigate to Setup > Objects and Fields > Object Manager.
Select the object type, click Fields & Relationships, then click the New button.
-
Enter the following properties:
Data type: Checkbox
Field Label: Deduplication Master Record
Default Value: Unchecked
Repeat these steps to add the Deduplication Master Record field to each object type synced with HubSpot that you'll need to deduplicate.
Add the Custom Field in HubSpot for Each Object Type
In HubSpot, navigate to Settings > Objects > Select an object
Click Manage [object] properties, and click the Create property button.
-
Enter the following properties:
- Label: Deduplication Master Record
- Field type: Single checkbox
- Click Create property.
Repeat these steps to add the Deduplication Master Record field to each object type synced with Salesforce that you'll need to deduplicate.
Set Property Mapping for Deduplication Master Record Field
Next, set the object settings to copy the value of the custom field from Salesforce into HubSpot (one-way).
In HubSpot, navigate to Settings > Integrations > Connected Apps > Salesforce.
On the app settings page, click the Data sync tab.
Select the object type from the menu on the left, then select Property mappings.
Click the Add new field mapping button and use the dropdown menus to select the "Deduplication Master Record" HubSpot property and Salesforce fields.
For the Sync Rule, select Always use Salesforce.
Click Save.
Follow the same process for each synced object type.
3. Deduplicate Salesforce Records in Insycle
To deduplicate Salesforce records in Insycle, navigate to Merge Duplicates and configure your matching and master selection rules as follows.
- Navigate to Data Management > Merge Duplicates, select the Salesforce database and object type.
-
In Step 1, choose Salesforce fields and criteria the values must meet to be considered a duplicate. In the example below, we are looking for Salesforce contacts with the exact same First Name and Last Name and Email Domain.
-
Under Step 3 on the Master tab, configure the rules that specify which record from each set of duplicates should become the master—the record that will remain after the merge that all the other duplicate records will merge into.
-
After Insycle identifies the master record, it uses the selection rules on the Fields tab to automatically select which values from a duplicate group to use in the master record.
For each field you want to control data retention for, you need to tell Insycle where the field's data should be sourced. This is merged into the master. For example, you could retain the record owner based on the earliest created record. Any data that is not in the master or not copied to it will be lost when the records are merged.
As part of the merge process, Insycle will automatically populate the Deduplication Master Record field with the value “True” for the record that is chosen as the master.
For further instructions on configuring your Salesforce deduplication, see the Salesforce Merge Duplicates Overview article.
To finish deduplicating your Salesforce records, continue with number 6. Preview Deduplication Changes, then Apply Merge to CRMs below.
4. Run an Incremental Insycle Sync Before the HubSpot Merge
Before running the HubSpot merge, you need to run an incremental sync in Insycle to pull the latest HubSpot data — including the Deduplication Master Record value that was written during the Salesforce merge. Without this step, Insycle may not yet reflect the updated field value, and the HubSpot merge will not correctly identify the master record.
This step is necessary because of a timing dependency in the process: when Insycle ran the Salesforce merge in Step 3, it stamped the Deduplication Master Record field on the master record in Salesforce. That value then propagated to HubSpot via the database synchronization between the two platforms. However, Insycle's own copy of the HubSpot data may not yet reflect that updated value. Running the incremental sync here ensures Insycle reads the current state of HubSpot before determining which record to select as master in Step 5.
-
Navigate to Settings > Sync Status, and next to the account name, click the Sync changes from last day button (lightning bolt icon).
-
You'll see a confirmation that Insycle has kicked off an incremental sync for the changes made in the last day.
Note: Manual syncing covers records modified in the past 24 hours, so this should reflect the Deduplication Master Record value written from Salesforce to HubSpot during the Salesforce merge.
Once the incremental sync is complete, proceed to Step 5 to run the HubSpot merge.
5. Deduplicate HubSpot Records in Insycle
After the Salesforce merge, the Deduplication Master Record values will automatically sync from Salesforce to HubSpot. This field can then be used to identify the same record as the master in HubSpot.
-
Under Step 1, use the same criteria as for Salesforce deduplication to determine which HubSpot records should be considered duplicates.
Under Step 3 on the Master tab, configure one rule—records with a Deduplication Master Record value of "Yes" should be selected as the master.
Because the incremental Insycle sync was run in Step 4, the Deduplication Master Record value stamped during the Salesforce merge is now available in HubSpot and ready to use for master selection.
For further instructions on configuring your HubSpot deduplication, see the HubSpot Merge Duplicates Module Overview article.
6. Preview Deduplication Changes, then Apply Merge to CRMs
Preview Merges in CSV Report
After you set up the deduplication rules for each CRM, you should preview the changes you are making to your data. That way, you can check to ensure your merge configuration is working as expected before those changes are pushed to your live database.
Under 4. Review in the Merge Duplicates module, click the Review button, then select Preview mode.
Click the Next button to go to the Notify screen, where you can select recipients for the email report. You can also add additional context to the message.
On the When tab, click the Run Now tab, and select which records to apply the change to, then click the Run Now button.
Insycle will generate a preview CSV and send it to your email. Open the CSV file from your email in a spreadsheet application.
The CSV report includes records from all duplicate groups. It shows the current state of the master record, excluding reassignments of associated contacts, deals, or activities. (To verify how these reassignments happen, run a small test in Update mode.) This ensures that the CSV accurately reflects the merge setup before execution in Update mode.
The Duplicate Group ID indicates which records will be merged together.
The Status column indicates:
- Duplicate – The record is part of a duplicate group.
- Master – The master record chosen for the duplicate group based on default behavior and your Record rules. Review the selections in this row to determine whether the appropriate records are being chosen.
- Master (After) – For each duplicate group, a special row –Master (After)– will appear in the CSV report. The Master (After) row shows the values the final record will contain based on your Field rules and the default behavior.
- Error – If Insycle is not able to determine which record would be the master, an error message will appear here. See the Troubleshooting section below for more details.
If everything looks good, return to Insycle and move forward with applying the changes.
Apply Changes to Your CRM Records
When you're satisfied with the results in your preview, you can merge the records in your CRM.
Under Step 4, click the Review button, and this time select Update mode.
On the When tab, select Run Now the first time you apply these changes to the CRM. You can do a small batch first to review the association reassignment and other changes in your CRM database.
Save Templates and Setup Automation for Ongoing Deduplication
After you've reviewed the results in the CRM and are satisfied with how the operation runs, you can set up ongoing automated deduplication for HubSpot and Salesforce records using Insycle templates.
With automation, you'll save time and ensure that HubSpot and Salesforce are consistently deduplicated while keeping the sync active.
For complete details on configuring the Merge Duplicates module, see the HubSpot Merge Duplicates Module Overview.
How the Deduplication Master Record Field Works
The Deduplication Master Record field is a custom field created in both Salesforce and HubSpot that allows Insycle to identify and use the same master record across both CRMs during deduplication, even while the database synchronization between the two platforms remains active.
When you merge duplicates, the records are combined into a single master record. If you merge records in two platforms, you must ensure that all duplicates in both platforms are merged into the same master record synced between HubSpot and Salesforce. When the master record differs, the sync between the two platforms breaks.
By creating a custom field that is synchronized across both CRMs, you give Insycle a reliable indicator of which record has been designated as master. When Insycle reads this field during the HubSpot merge, it selects the same record that was designated as the master in Salesforce — ensuring both platforms converge on the same record and that database synchronization between them remains intact.
The CRM you deduplicate first will set the master, so you'll set up complete master selection rules in Step 3. Merge Logic of Insycle's Merge Duplicates module. When you run this merge duplicates operation on the first CRM, Insycle will set the "Deduplication Master Record" field to "True" in Salesforce or "Yes" in HubSpot for the record identified as the master.
When you run the merge operation on the second CRM, you only need to specify how to select the same master record based on the "Deduplication Master Record" value being "True/Yes."
Alternative: Create a HubSpot ID Field in Salesforce
The Deduplication Master Record field approach described in this article is the recommended method for most teams. However, if you prefer not to use it, there is an alternative that achieves the same goal — identifying which Salesforce record is actively synchronizing with HubSpot so it can be selected as master.
Because Salesforce lacks a native field indicating which of its records are linked to HubSpot, you can create one. In Salesforce, create a custom number field (18 digits) on each object type you plan to deduplicate. Then, in HubSpot's Salesforce integration property mappings, map the HubSpot record ID to that custom Salesforce field and set the sync rule to Two-way. Because the HubSpot record ID is system-generated and not editable, Salesforce cannot overwrite it — so the sync behaves safely in one direction. After the sync runs, any Salesforce record with a linked HubSpot counterpart will have this field populated; records without one will have it empty. You can then use this field in Insycle's Master Selection rules to select master records that have the field populated.
Note that regardless of which approach you use, setting HubSpot's deletion behavior to "Do nothing" (Step 1) is still required.
Troubleshooting
This section addresses common issues that may arise when deduplicating records across HubSpot and Salesforce.
Insycle isn't finding any duplicates
Most of the time, when Insycle can't find duplicates, it's because your matching rules in Step 1 aren't set correctly. However, before making any changes, verify that the fields you're using for duplicate detection are properly synced between HubSpot and Insycle.
First, check field synchronization.
Go to Settings > Fields and make sure the Sync toggle is enabled (yellow), or the Automation box is checked for all fields you're using in Step 1.
Then, analyze matching rules.
To analyze the underlying data and better understand how to set up your rules in Step 1, a helpful exercise is to configure your matching filters to find exact matches for only First Name and Last Name. Or for companies, you could use company name.
When you click Find, these rules can show you a broad overview of what duplicates are potentially in your database and what fields might be useful to include in your matching fields. These settings are intended for discovery purposes only and should not be used for a final merge operation, as many individuals may share the same first and last names without being duplicates.
For more context, in Step 2, click the gear button on the right side of the title bar. Here, you can add any field from your database as a column in the duplicate group review to better understand the data in these records. These will also appear in your CSV report.
"Failed" Result in CSV with "Change rules in Step 3 'Master Selection'" Message
If the Result is "Failed" and the Message column of the CSV report displays this text:
Change rules in Step 3 'Master Selection'. Failed to pick master record because multiple records (X) meet the selection criteria. In 'Master Selection', change, add, or reorder the rules such that only one record matches (if cannot determine master based on field values, use 'Record ID is lowest' as the last rule).
This means Insycle could not determine which record in the duplicate group should become the master — none of the records meet more of the rules than the others.
There are a few things you can try to resolve this:
-
Under Step 3, on the Master tab, experiment with reordering or adding rules based on fields that are likely to have unique values across your records. Think about what matters most to your business — the fields that would make one record clearly more valuable or authoritative than another. For example:
- A field that stores an ID linked to an external system, such as an ERP, data warehouse, or proprietary internal tool — the record with that ID populated is likely the one your other systems depend on
- The record with the highest number of associated records (contacts, deals, activities) — indicating it has accumulated more history and relationships
- A field indicating CRM ownership or account status — for example, a record marked as "Customer" vs. "Lead," or one with an active owner assigned
- A field that tracks revenue, subscription tier, or engagement level — the record with higher values may represent the more complete or current entry
- A custom field your team uses to flag record quality or data source reliability
The goal is to surface the fields that reflect record importance for your specific operations, not just default system fields.
-
Also on the Step 3 Master tab, confirm that By Priority is selected rather than Absolute.
With By Priority, a record only needs to match one rule to be selected as master. With Absolute, a record must meet all rule criteria, which makes it much harder for any single record to qualify.
In most cases, By Priority is the right choice. If By Priority is already selected and the error persists, none of the records in the group meet any of the criteria more than the others. Return to the Master tab and continue adding or reordering rules, focusing on the business-critical fields described in #1 above.
- As a last resort, add a rule on the Master tab that uses Record ID is lowest, or Create Date is earliest. These rules will always produce a unique winner, ensuring master selection can complete even when other field-based rules cannot differentiate the records.
It's taking a long time for Insycle to find duplicates
It can take Insycle a while to find and match duplicates when the fields used to identify them have very long values. The longer the values, the longer it takes Insycle to process the data and generate the results. This might come up when looking for matches based on long ID numbers, LinkedIn bio links, or other URLs with long strings attached (ex, https://www.linkedin.com/in/svadin%C3%ADr-n%C4%9Bmec-1234b31a3/).
You can speed this up by limiting how much of the value Insycle looks at.
If the beginning or ending portion of the values are all unique, you can limit the comparison to the first or last several characters using the Match Parts parameter under Step 1.
Or use the Ignore Text (Substrings) parameter, then click the Terms button.
On the Ignored Text tab of the popup, add the common portion of the URL or text string.
Frequently Asked Questions
Can I merge HubSpot companies and Salesforce accounts without breaking the sync?
You can merge Salesforce accounts and HubSpot companies without breaking the database synchronization between the two platforms by using Insycle's Merge Duplicates module. To learn more, see the article Deduplicate HubSpot Companies and Salesforce Accounts.
Does it matter which platform I run the original deduplication process in?
Technically, it does not matter whether you deduplicate Salesforce or HubSpot records first — the Deduplication Master Record field will be populated automatically in whichever CRM you run the merge in first, and that value will carry over to the other platform.
That said, this article follows a Salesforce-first approach, which is recommended when both platforms are actively synchronizing.
How can I tell which Salesforce record is actively syncing with HubSpot?
Salesforce has no native field indicating whether a record is actively synchronizing with HubSpot — that information lives on the HubSpot side, via the Salesforce object ID property. Without visibility into this from the Salesforce side, you cannot reliably use Insycle's Master Selection rules to guarantee the syncing record becomes the master.
There are two ways to create that visibility:
- Use the Deduplication Master Record field approach — This is the method described in this article. A custom checkbox field is created in both CRMs and synchronized one-way from Salesforce to HubSpot. After Insycle runs the Salesforce merge and stamps the master, that value propagates to HubSpot and is used to align master selection in the HubSpot merge. This is the recommended approach for most teams.
- Create a custom Salesforce field that HubSpot writes its record ID into — In Salesforce, create a custom number field (18 digits) on each object type you plan to deduplicate. Then, in HubSpot's Salesforce integration property mappings, map the HubSpot record ID to that custom Salesforce field with the sync rule set to Two-way. Because the HubSpot record ID is system-generated and not editable, Salesforce cannot overwrite it — so two-way sync behaves safely here. After the sync runs, that Salesforce field will be populated on any record with a linked HubSpot counterpart and left empty on records without one. You can then use that field in Insycle's Master Selection rules — records where this field is populated should be preferred as master.
In both cases, setting HubSpot's deletion behavior to "Do nothing" first is still required as a safety net, regardless of which approach you use.
The image above shows the Do Nothing setting in HubSpot. Refer to the Required Salesforce-HubSpot Sync Setting step for detailed configuration instructions.
Do I have to create the Deduplication Master Record field for this to work?
Creating the Deduplication Master Record field in both Salesforce and HubSpot is required for the approach described in this article. Without it, Insycle has no reliable way to identify which record was selected as master in Salesforce and carry that selection over to HubSpot, which means both merges may not converge on the same master record, breaking the database synchronization between the two platforms.
If you prefer not to use the Deduplication Master Record field, an alternative is to create a custom Salesforce field that HubSpot writes its record ID into via the sync property mappings. This gives you a Salesforce-side indicator of which records are actively synchronizing with HubSpot, which you can then use in Insycle's Master Selection rules. See the FAQ: How do I know which Salesforce record is actively syncing with HubSpot? for details on both approaches.
After merging in both Salesforce and HubSpot, why isn’t the "Deduplication Master Record" option Yes/True in either CRM?
When you’ve merged duplicate records in Salesforce or HubSpot (whichever you’ve done first), the “Deduplication Master Record” value should be set to "True" in Salesforce and "Yes" in HubSpot in both CRMs by the sync. However, it may happen that synchronization of this data to Insycle is delayed. In this case, when you perform the merge operation on the second platform, it does not know that the “Deduplication Master Record” value is now “yes/true,” so it sets the value to "no/false" in the CRM, which is then synced to the other CRM.
To resolve this, after running the operation in the first CRM, perform an incremental sync in Insycle on the second CRM before running that merge operation.
Navigate to Settings > Sync Status, and next to the account name, click the Sync changes from last day button (lightning bolt icon). You should now be able to proceed with the second merge.
Alternatively, you can run your merge in Salesforce first, then use a HubSpot Workflow to trigger the corresponding merge. Set up the trigger “Deduplication Master Record is known.” This will push the latest values for any enrolled records to Insycle in real-time.
The image above shows a HubSpot Workflow configured to trigger on 'Deduplication Master Record is known,' which pushes the latest field values to Insycle in real time.
Some of my duplicates have attachments. Will these be preserved?
Attachments on HubSpot records are preserved during a merge — the attachment will be merged into the master record. Note that there may be a short delay before the attachment appears on the merged record.
I used the “From master record (even empty)” retention rule. Why does HubSpot say Insycle deleted it?
When merging HubSpot contact records using the “From master record (even empty)” Field rule in Step 3, the property history in HubSpot shows that Insycle set the value to “empty.” This is a nuance of how HubSpot manages the history of empty values. You can verify that the master record value before the merge was indeed empty by reviewing the Activity Tracker report in Insycle.
Check out the Merging Duplicates FAQ for more information.
Additional Resources
Related Help Articles
- Deduplicate HubSpot Companies and Salesforce Accounts
- Deduplicate HubSpot Contacts, Companies, and Deals in Bulk
- HubSpot Merge Duplicates Overview
- Merge Duplicates Configuration Reference
- Deduplication Best Practices
Related Blog Posts
- How to Merge Duplicates in HubSpot and Salesforce and Keep Them Syncing
- How Insycle Solves Common Problems with HubSpot and Salesforce Integration
- Salesforce Duplicate Management: How to Automate Salesforce Deduplication
- Data Duplication and HubSpot: Dealing With Duplicates and the Impact They Have on Your Business