Deduplicate HubSpot Companies and Salesforce Accounts

How to Merge Duplicate Salesforce Accounts and the Corresponding HubSpot Companies

If your HubSpot and Salesforce CRMs are configured to sync, cleaning up duplicates can become tricky. You need to decide which “master record” to use in both CRMs and how to handle the merge. Often, your settings in each platform influence how the merge occurs.

When you deduplicate accounts in Salesforce, the master record is kept in sync with the original HubSpot record, as indicated by the Salesforce Account ID. But deduplication occurs only on the Salesforce side—leaving duplicate companies in HubSpot. Since HubSpot doesn't let you deduplicate companies while the sync is active in the HubSpot app, you need another option.

Insycle allows you to merge duplicate HubSpot companies and Salesforce accounts while keeping things simple and your sync intact.

This article covers a specific scenario: deduplicating HubSpot companies and Salesforce accounts using the Salesforce Account ID field to identify the correct master record in HubSpot. This approach works because only the HubSpot company actively synchronizing with Salesforce will have a Salesforce Account ID, making it a reliable master selection indicator without requiring a custom field.

If you are deduplicating contacts or other object types across both platforms, or if you need a more general cross-CRM deduplication process, see Deduplicate HubSpot and Salesforce While Keeping the Sync Active.

Process Summary

  1. Verify that HubSpot's deletion behavior is set to "Do nothing" before any merge operations. 
  2. Merge duplicate Salesforce accounts in Insycle. 
  3. Set up HubSpot merge rules to select the HubSpot record that has a Salesforce Account ID as the master record. 
  4. Merge duplicate HubSpot companies in Insycle.

Step-by-Step Instructions

1. Before You Start: Verify One HubSpot Sync Setting

Before merging any duplicate records in Salesforce, verify one HubSpot setting. 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 in Salesforce. 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 the companies object type you plan to deduplicate must be set to “Do nothing” before you begin.

  1. In HubSpot, navigate to Settings > Integrations > Connected Apps.
  2. Click Salesforce in the My Apps list.
  3. On the app settings page, click the Data sync tab.
  4. In the left sidebar menu, click Companies, then click Sync rules.
  5. Under Deleting Companies, verify that the following setting is in place:
    • When a Salesforce account is deleted → Do nothing in HubSpot.
hubspot-settings-connected-apps-sync-rules-deleting-companies-646w.png

The image above shows the Deleting Companies section of the Company Sync Rules page on the Data sync tab of the Salesforce integration in HubSpot. When an account is deleted in Salesforce, HubSpot is set to Do nothing. When a company is deleted in HubSpot, Salesforce is set to Do nothing. Both settings appear in gray fields without dropdown arrows.

For complete setup instructions, see the Required HubSpot-Salesforce Sync Setting step in Deduplicate HubSpot and Salesforce While Keeping the Sync Active.

Note: After completing the Salesforce merge, any HubSpot records whose Salesforce counterparts were merged away will remain in HubSpot as unlinked records and will need to be cleaned up separately. These unlinked companies no longer have a Salesforce Account ID. This is expected behavior when the deletion setting is "Do nothing."

2. Deduplicate Salesforce Accounts in Insycle

Navigate to Data Management > Merge Duplicates, and select the Salesforce database and Accounts object type from the top menu. Then explore the templates for an existing solution that may be close to what you need.

Each row in Step 1. Find Duplicates is for a field you want to look at for duplicates, along with some parameters on what to look for. For example, you may look for account records that have a similar Account Name and the exact same Website. Learn more about Setting the Criteria for Finding Duplicate Matches.

merge-duplicates-salesforce-accounts-step-1-simple-tab-name-website-646w.png

The image above shows the 1. Find Duplicates step in the Merge Duplicates module for Salesforce accounts. Two rules are set on the Simple tab: Account Name using Similar Match with Common Terms ignored and the Entire Value compared, and Website using Exact Match with the Top-Level Domain ignored and the Entire Value compared. The Find, Field, Filter, and Terms buttons appear below the rules.

Under Step 3. Merge Logic on the Master tab, configure the rules that specify which record all the other duplicate records will merge into. This will be your master record. Select the field that gives the most likely indication that a record might be the master record, and what condition this field must meet.

For each duplicate group, Insycle will examine each Master rule to determine which records in the group meet the criteria. Rules are read in order, from top to bottom. The first record that is the only one that matches a rule will be selected as the master record, and subsequent rules will be ignored. Learn more about Choosing Which Record Remains After a Merge.

merge-duplicates-salesforce-accounts-step-3-master-tab-name-owner-created-ID-646px.png

The image above shows the 3. Merge Logic step in the Merge Duplicates module in Bulk mode for Salesforce accounts.  Four master rules are listed in order on the Master tab: Account Name regex [A-Z]{3,}, Account Owner is an active user, Created Date is earliest, and Account ID is lowest. Processing is set to By Priority, and Exclusions skips duplicate groups with more than 5 records.

After Insycle identifies the master record, it uses the selection rules on the Fields tab to 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. Learn more about Keeping the Right Data When Records Merge.

merge-duplicates-salesforce-accounts-step-3-fields-name-phone-SLA-ownership-owners-ID-country-SIC-646w.png

The image above shows the 3. Merge Logic step in the Merge Duplicates module in Bulk mode for Salesforce accounts. It shows 8 rules set on the Fields tab: Account Name, SLA, and Account Phone (even if empty) come from the master record. Ownership uses the most frequent value. Merged Owners collects Account Owner values, and Merged Account IDs collects non-master Account ID values. Shipping Country comes from the latest record, and SIC Description combines and appends all values.

To finish deduplicating your Salesforce records, continue with #4. Preview Deduplication Changes, then Apply Merge to CRMs below.

For further instructions on configuring your deduplication, see the Salesforce Merge Duplicates Overview.

3. Deduplicate HubSpot Companies in Insycle

When duplicate companies are created in HubSpot, the duplicates won't automatically sync with Salesforce, so the Salesforce Account ID field will be blank.

Since only the company synchronizing with Salesforce has the Salesforce Account ID, the presence of this value can be used to identify the correct HubSpot record to designate as the master.

Under Step 1, use the same criteria as for Salesforce deduplication to determine which HubSpot records should be considered duplicates. Learn more about Setting the Criteria for Finding Duplicate Matches.

merge-duplicates-hubspot-companies-step-1-simple-tab-similar-name-exact-domain-646w.png

The image above shows the 1. Find Duplicates step in the Merge Duplicates module for HubSpot companies. Two rules are set on the Simple tab: Company name using Similar Match with Common Terms ignored and the Entire Value compared, and Company Domain Name using Exact Match with the Top-Level Domain ignored and the Entire Value compared. The Find, Field, Filter, and Terms buttons appear below the rules.

Under Step 3, on the Master tab for the very first rule, select the Salesforce Account ID field with the Condition "exists." Since these rules execute in order, if the Salesforce Account ID is found in one of the duplicate records, that record is chosen as the master, and the rest of the rules in the list are ignored.

At the bottom, ensure By Priority is selected.

Learn more about Choosing Which Record Remains After a Merge.

merge-duplicates-hubspot-companies-step-3-master-tab-salesforce-account-id-w-arrow-646w.png

The image above shows the 3. Merge Logic step in the Merge Duplicates module for HubSpot companies in Bulk mode. On the Master tab, an arrow points to the first rule, Salesforce Account ID exists, which selects the company syncing with Salesforce as the master. The other rules, in order, are Number of Associated Deals is highest, Company owner exists, and Create Date is earliest. Processing is set to By Priority.

After Insycle has identified the master record, it will use the data retention rules from the Fields tab to automatically pick which values from a duplicate group will be used in the master record.

If you do not specify what to keep for a field, when a field value is empty in the master record, Insycle automatically picks a non-empty value from the most recently updated duplicate.

Once you think you have all your Master and Field rules set, run a preview to see how it goes.

Learn more about Keeping the Right Data When Records Merge.

merge-duplicates-hubspot-companies-step-3-fields-tab-owner-industry-revenue-lifecycle-employees-646w.png

The image above shows the 3. Merge Logic step in the Merge Duplicates module for HubSpot companies in Bulk mode. 5 rules are set on the Fields tab: Company owner comes from a record where the value is an active user; Industry comes from the record with the earliest Last Modified Date; and Annual Revenue comes from the master record. Lifecycle Stage comes from a record where the value is Customer, and Number of Employees from the record with the highest value.

4. Preview Deduplication Changes, then Apply Merge to CRMs

Preview each merge before you apply it. Run the #2. Salesforce accounts merge in Preview mode and review the CSV report, then apply it in Update mode. After you complete the #3. HubSpot companies merge, repeat the same Preview and Update process for the HubSpot companies merge.

The first time you apply each merge in Update mode, consider merging a small batch first to check how associations are reassigned in your CRM. Once both merges run as expected, you can save your configurations as templates and automate them so Salesforce and HubSpot stay deduplicated while the sync is active.

For the full walkthrough, including how to read the CSV Status column, choose which duplicate groups to include, and schedule your merge, see Running Your Merge.

salesforce-accounts-csv-2023-06-05.png

The image above shows a Merge Duplicates CSV report for Salesforce accounts with columns for Result, Message, Duplicate Group ID, Status, Account Name, Website, and Record ID. In the Bosder group, two Duplicate rows merge into the Bosder Master row. In the Binswi group, Binswi inc, Binswi llc, and Binswi ltd merge into the Binswi Master row. Each group ends with a bolded Master (After) row, and every row shows Merged and Succeeded.

Advanced How-Tos

Frequently Asked Questions

Does it matter which platform I run the original deduplication process in?

Yes, it matters which platform you run the original deduplication process in: merge duplicate Salesforce accounts first, then merge duplicate HubSpot companies. After the Salesforce merge, the HubSpot company that syncs with the remaining Salesforce account is the one with a Salesforce Account ID, which Insycle uses to select the master in the HubSpot merge. Merging in Salesforce first also keeps the sync from re-creating merged records. For a full explanation, see Does it matter which platform I run the original deduplication process in? in Deduplicate HubSpot and Salesforce While Keeping the Sync Active.

Does HubSpot allow you to merge companies while the sync is active?

No. HubSpot doesn't let you merge companies from the HubSpot application when the sync is active, but Insycle does.

How does Insycle pair the master record between HubSpot and Salesforce?

Insycle pairs the master record between HubSpot and Salesforce by using the Salesforce Account ID property on HubSpot companies. When you merge duplicate Salesforce accounts first, only one Salesforce account remains in each duplicate group, so only one HubSpot company still syncs with it and has a Salesforce Account ID. In the HubSpot merge, a Master rule of Salesforce Account ID exists selects that company as the master, matching the master record in Salesforce. 

Check out the Merging Duplicates FAQ to find answers to other common questions about merging duplicates.

Additional Resources

Troubleshooting

Review the Merge Duplicates Troubleshooting article if you're not seeing the results you expect when merging duplicates.

Related Help Articles

Related Blog Posts