How to Merge Duplicates across Salesforce and HubSpot While the Sync Is Active
Your company is using both Salesforce and HubSpot and is running into problems with duplicate records in one CRM or the other, and sometimes both.
You have a data sync set up between the two systems but don't know how to deduplicate effectively to ensure the cleanup effort is consistent across CRMs. In addition, you can't deduplicate companies from within the HubSpot app while the sync is active.
With Insycle's Merge Duplicates module, you can merge duplicate people or companies into the same master record in both CRMs and ensure the records stay synced moving forward in bulk and automatically. This can be done when the Salesforce-HubSpot sync is active, and the master records will continue syncing after the merge. You can also control the merge process by defining rules for picking the master record and which field values should be retained.
Process Summary
- Set up your Salesforce-HubSpot sync settings.
- Create a custom field in each CRM to identify the master record.
- Deduplicate your Salesforce records.
- Deduplicate your HubSpot records.
Step-by-Step Instructions
First, make sure your settings to sync Salesforce with HubSpot are set up for this process to work. This is a required step.
In HubSpot, navigate to Settings > Integrations > Connected Apps > Salesforce "Actions" Button > Go to settings.
On the app settings page, click the Object tab.
To ensure that duplicates are not automatically deleted when you merge in Salesforce, under Deleting [Objects], verify that the settings are as follows:
- When a Salesforce contact is deleted → Do nothing In HubSpot
- When a Salesforce lead is deleted → Do nothing In HubSpot
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, Salesforce and HubSpot, add a custom field named “Deduplication Master Record.” This must be added to any synced record/object type 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 the object type > Manage [object] properties, and click the Create property button.
Enter the following properties:
- Label: Deduplication Master Record
- API name: deduplication_master_record
- Data type: Single checkbox
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, you need to 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, and select the object type tab. Click the [Object] property mappings tab.
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.
Follow the same process for each synced record/object type.
Now, you can start merging Salesforce duplicates with Insycle.
Navigate to Data Management > Merge Duplicates, select the Salesforce database and record 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 has identified the master record, it will use the selection rules from the Fields tab to automatically pick which values from a duplicate group will be used in the master record.
For each field you want to control the data retention for, you need to tell Insycle where the data for the field should be taken from. This is merged into the master. Any data that is not in the master or not copied to the master will not be kept 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 deduplication, see the Module Overview: Merge Duplicates article.
To finish deduplicating your Salesforce records, continue with 5. Preview Deduplication Changes, then Apply Merge to CRMs below.
After the merge in Salesforce, 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 the 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" (or "True," depending on the setup) should be selected as the master.
This will ensure that the master record in HubSpot aligns with the one in Salesforce. Due to the sync, the “Deduplication Master Record” value is available in HubSpot.
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 Step 4, click the Review button and 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 guarantees that the CSV accurately represents the merge setup before executing 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 Master 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 cannot determine which record is 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 5, click the Review button, and this time select Update mode.
On the When tab, use 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 database.
Save Templates and Setup Automation to Maintain Formatting
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 Salesforce and HubSpot records using Insycle templates.
With automation, you'll save time and ensure that Salesforce and HubSpot are consistently deduplicated while keeping the sync active.
For complete details on configuring all Merge Duplicates module settings, see the Salesforce Merge Duplicates Overview.
Advanced Info
Deduplicating across Salesforce and HubSpot while the sync is active can be challenging.
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, which effectively says, "This is the master record!", you ensure both CRMs use the same master record when the deduplication process is run in Insycle.
The CRM you deduplicate first will set the master, so you'll set up complete master selection rules in Step 4 of the Merge Duplicates module. When you run this merge duplicates operation on the first CRM, Insycle will set the "Deduplication Master Record" field value to "True/Yes" on the record identified as master.
When you run the merge operation on the second CRM, you only need to select the same master record if the "Deduplication Master Record" value is "True/Yes."
Troubleshooting
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.
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 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.
Tips for Bulk Merging Duplicates
- Begin with easy-to-find duplicates. Iterate through fields and rules you know will surface duplicates. Don’t expect to resolve all your duplicates by setting up and running this process once. You will need to run this process multiple times for different fields or nuanced variations.
- Save templates. Each time you get a Merge Duplicates process to run the way you want in your database, save it as a template. When you have a solid set of templates that reliably resolve most of your dupes, you can put them together as a Recipe that can run on a regular, automated schedule.
- Look for edge cases that fall outside your standard rules. These may be templates you run manually so you can make adjustments based on what you find.
- Do some experimentation. Use the Preview mode CSV report to analyze patterns in the duplicates. Add additional fields to the CSV by clicking the gear icon in Step 2 and including them in the Layout. You may learn what is causing the duplicates and learn how to avoid having them in the first place. You may also want to explore your data in the Grid Edit module to understand what you have so you can design templates that catch all potential variations.
Frequently Asked Questions
Yes. You can use Insycle to merge records while the sync is active, even though this isn't supported within the HubSpot app. To learn more, see the article Deduplicate HubSpot Companies and Salesforce Accounts.
No. You can deduplicate either Salesforce or HubSpot records first—the "Deduplication Master Record" field will be populated automatically.
Yes. The Deduplication Master Record field is a key requirement for deduplicating across Salesforce and HubSpot without breaking the sync. Keeping the master records consistently labeled across both platforms is how you are able to keep the sync active.
When you’ve merged duplicate records in Salesforce or HubSpot (whichever you’ve done first), the “Deduplication Master Record” box should be checked (yes/true) 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 other platform, it does not know that the “Deduplication Master Record” value is now “yes/true,” so it unchecks the box 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.
Yes, if your HubSpot objects have attachments, the attachment will be merged into the master record. Note that there may be a short delay before the attachment appears in the merged record.
When merging HubSpot contact records using the “From master record (even empty)” data retention rule, 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.
Additional Resources
Related Help Articles
- Deduplicate Across Salesforce Leads and Contacts
- Deduplicate HubSpot Companies and Salesforce Accounts
- Bulk Merge Duplicate People, Companies
- Salesforce Merge Duplicates Overview
Related Blog Posts
- How to Merge Duplicates in HubSpot and Salesforce and Keep Them Syncing
- Salesforce Duplicate Management: How to Automate Salesforce Deduplication
- Hidden Duplicates: 11 Advanced Ways to Identify & Deduplicate Customer Data
- Data Duplication and HubSpot: Dealing With Duplicates and the Impact They Have on Your Business