Deduplicate HubSpot Companies and Salesforce Accounts

How to Merge Duplicate Salesforce Accounts and the Corresponding HubSpot Companies

If you have your HubSpot and Salesforce CRMs set up to sync, this can make cleaning up duplicates tricky. You need to determine the appropriate “master record” to use across both CRMs and, you have to consider the merging process. Often, your settings in each platform impact how the merge takes place.

When you deduplicate accounts in Salesforce, the master is kept in sync with the original HubSpot record, indicated by a Salesforce Account ID value. But the deduplication only takes place on the Salesforce side—leaving duplicate companies in HubSpot. Since HubSpot doesn't allow you to deduplicate companies while the sync is active from within 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.

Process Summary

  1. Merge duplicate Salesforce accounts.
  2. Set up HubSpot merge rules to select the HubSpot record that has a Salesforce Account ID as the master record.
  3. Merge duplicate HubSpot companies.  

 

Step-by-Step Instructions

1. Deduplicate Salesforce Accounts in Insycle

Navigate to Data Management > Merge Duplicates, and select the Salesforce database and Accounts record 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 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.

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

Under Step 3 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 look at each Master rule to see which of the 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 further rules will be ignored.

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

After Insycle has identified the master record, it will use the selection rules from the Field 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 included in the master once merged.

step-4-fields-salesf-accts-all-criteria-2023-06-01.png

To finish deduplicating your Salesforce records, continue with the 3. Preview Deduplication Changes then Apply Merge to CRMs step below.

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

2. 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.

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

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, it will be chosen as the master and the rest of the rules in the list are ignored.

At the bottom, ensure By Priority is selected.

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

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.

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

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.

For a full reference of all matching options, conditions, and advanced configuration, see the HubSpot Merge Duplicates Module Overview.

3. Preview Deduplication Changes, then Apply Merge to CRMs

Preview Merges in CSV Report

After you have the deduplication rules set up 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.

merge-duplicates-step-4-review-preview-mode-tab-646w.png

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 (in most cases this will be All), then click the Run Now button.

merge-duplicates-step-4-review-preview-run-now-custom-646w.png

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 validate how these reassociations occur, run a small-scale test in Update mode.) This ensures that the CSV accurately reflects the merge setup before execution in Update mode.

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

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 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, you should 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 each CRM.

merge-duplicates-step-4-review-update-run-now-chunk-646w.png

Save Templates and Setup Automation to Maintain Formatting

After you've seen the results in the CRM and you are satisfied with how the operation runs, you can set up ongoing automated deduplication for HubSpot and Salesforce records with Insycle templates, or integrate with Hubspot Workflows or Salesforce Flows.

With automation, you'll save time and ensure that HubSpot and Salesforce are consistently deduplicated while keeping the sync active.

merge-duplicates-step-4-review-update-automate-daily-646w.png

Advanced How-Tos

Use a filter to work with a subset of your data

If your database is large or you're getting an overwhelming number of duplicate groups, use the Filter button in Step 1 to narrow down the records Insycle analyzes. Filtering to a subset — for example, contacts created in the last 30 days, or companies in a specific region — makes it easier to validate your configuration before running it across your full database. A filtered dataset also processes faster.

To add a filter, click the Filter button in Step 1, choose a field, select a condition, and set a value. The filter is applied before the matching step runs.

dup10.png

Most of the options in the Field dropdown match the fields that are found in your HubSpot records, and for contact records, there are three additional options related to the Email value: 

  • Email Username: The portion of the email address before the “@.” For example, if the email address were “maria@acmewidgets.com,” the username value would be “maria.” 
  • Free Email Provider Domain: Choose True to filter out records where the email domain is Gmail, Hotmail, Yahoo, or any of about 10,000 other free email providers. This filter helps ensure these are real clients, or can determine which record is the legitimate one, because it’s most likely that customer companies aren't using free Gmail accounts (though a contact may have accidentally emailed us from one at some point). 
  • Email Top-Level Domain: The top-level domain (TLD) is everything that follows the final dot of a domain name. For example, in the domain name acmewidgets.com, '.com' is the TLD. Some other popular TLDs include '.org', '.uk', and '.edu'. 
Start narrow, then broaden

When setting up your matching fields for the first time, start with your highest-confidence criteria — fields that, together, are very unlikely to match unless the records are true duplicates. Exact Match on email address plus first and last name is a reliable starting point for contacts. Domain Name is a strong starting point for companies.

merge-duplicates-hubspot-companies-step-1-similar-name-domain-exact-phone.png

Once you're confident your configuration is catching true duplicates without pulling in false positives, you can broaden your criteria — for example, by adding Similar Match to catch typos and slight variations: 

merge-duplicates-hubspot-companies-step-1-comparison-rules-646w.png

Or, by using Related Fields to compare values across two fields that contain similar data (such as Email and Additional Email).

merge-duplicates-hubspot-contacts-step-1-advanced-first-last-email+additional-646w.png
Understanding how master selection works

Insycle evaluates your Master tab rules from Step 3 in order, eliminating records that don't match each rule until only one remains. If multiple records still match after all rules are evaluated, no master can be determined, and the group will show an error in the CSV.

For example, imagine having four duplicate records for the same contact. (In this image, we are examining the records in the Grid Edit module.)

mceclip11.png

In the Merge Duplicates module, you have configured the first three Master rules based on email engagement metrics, but all four records have identical values of zero, so no records are eliminated. Your fourth rule checks for an active Contact Owner — three records have no owner, so they're eliminated. The one remaining record becomes the master.

This is why rule order matters. Place your most reliably differentiating rules — like record owner, lifecycle stage, or engagement activity — where they're most likely to yield a clear winner. If you're frequently seeing errors in your CSV, revisit your rule order and consider adding a tiebreaker rule, such as earliest Create Date or latest Last Modified Date, as a final fallback.

merge-duplicates-hubspot-contacts-step-3-master-tab-6-rules.png

In this CSV report example, you can see that the one record with an active owner was chosen as the master.

mceclip13.png
Adding Extra Fields to Your CSV Export

If you're uncertain about how conflicting field values will merge, you can add those fields to the Preview CSV report by including them in the Layout via the icon-gear-18x18.png gear icon in Step 2.

merge-duplicates-hubspot-contacts-job-title-layout-646w.png

This is also useful if there are fields you're worried about backing up; including them in the CSV report allows you to refer back to the values in the CSV sent to your email or downloaded from the Activity Tracker.

merge-duplicates-hubspot-contacts-job-title-csv-646w.png

Explore other advanced approaches to merging duplicates in our Deduplication Scenarios article.

Need More Control Over Which Records Are Merged?

If your scenario requires selecting specific records to include or exclude that can't be handled with matching rules alone, you have three options: 

To handle this in bulk, you can upload a CSV file of known duplicate record ID pairs directly into the Merge Duplicates module using the CSV tab in Step 1. For more complex scenarios — such as designating master records or excluding specific records using custom attributes — you can use the Magical Import module in combination with Merge Duplicates. Learn how to customize merging duplicates in bulk using a CSV

To handle records one at a time, use Manual mode in the Merge Duplicates module. Learn more about merging duplicates in Manual mode.

Troubleshooting

"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).

merge-duplicates-salesforce-accounts-csv-w-error.png

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:

  1. 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.

  2. 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.

    merge-duplicates-step-3-by-priority-match-w-arrow-646w.png

  3. 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. merge-duplicates-hubspot-contacts-step-3-master-tab-last-resort-rules.png
Insycle isn't finding any duplicates

Most of the time, when Insycle can't find duplicates, it is due to your matching rules in Step 1. It is important to analyze the underlying data to better understand how to set up your rules. A helpful exercise for contacts is to set up your matching filters to find exact matches on only First Name and Last Name. For companies, you can use Company Name.

step-1-fname-Lname-only.png

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 just for discovery and should not be used for a final merge operation; many people can have the same first and last names and are not duplicates. 

To get further context, on Step 2, click the layout gear icon-gear-18x18.png 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. 

merge-duplicates-step-2-gear-arrow-646w.png
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

merge-duplicates-linkedin-URL-step-1-match-parts-last-9-chars-646w.png

merge-duplicates-linkedin-bio-step-2-last-9-chars.png

Or use the Ignore Text (Substrings) parameter, then click the Terms button.

merge-duplicates-linkedin-URL-step-1-ignored-text-terms-button-646w.png

On the Ignored Text tab of the popup, add the common portion of the URL or text string.

merge-duplicates-linkedin-URL-step-1-ignored-text-popup-646w.png

Getting error: Cannot merge object...has more than 250 objects merged...

If you see the following error for a HubSpot record after you run an operation:

“Cannot merge object [ID] in portal [ID]. It already has more than 250 objects merged into it.”

This suggests that too many duplicates are trying to merge into a single record.

What’s Happening

HubSpot enforces a strict limit on merges. A contact, company, or deal cannot have more than 250 merged records associated with it. HubSpot tracks all previous merges using the read-only property called Merged Record IDs. When a record has already reached (or will reach) 250 merged items, HubSpot blocks any further merges. There is no way to clear or edit this field, or to bypass the limit in the HubSpot app.

Solution

As a workaround, you can switch to Insycle’s Synthetic Merge. In the Merge Duplicates module, go to Step 3 and select the Method tab. Switch the Merge API option from Native to Synthetic. If this is a template, don't forget to save. 

For more details, refer to this Native Merge vs. Synthetic Merge info.

merge-duplicates-hubspot-step-4-method-tab-synthetic-646w.png

Frequently Asked Questions

Can I merge HubSpot and Salesforce companies and accounts without breaking the sync?

Yes. With Insycle, you can first deduplicate in Salesforce, then deduplicate in HubSpot using the Salesforce Account ID field to match the master record, all while the sync is active. 

If you were to try to merge companies within the HubSpot application, it wouldn't work when the sync is active.

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

Yes, because HubSpot doesn't let you merge companies when the sync is active, it is best to deduplicate in Salesforce first and then follow the steps laid out in this article to ensure that the duplicate companies are also removed in HubSpot.

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?

When you deduplicate Salesforce accounts first, you can look for records with a Salesforce Account ID when you deduplicate HubSpot companies. 

As long as you deduplicate Salesforce accounts first when you deduplicate HubSpot companies, you can look for records that have a Salesforce Account ID. Since the Salesforce records have already been merged, there will only be one left with a Salesforce Account ID. The HubSpot records that have this match the master record in Salesforce. 

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)” 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.

Some of my HubSpot duplicates have attachments. Will these be preserved?

Yes, if your HubSpot objects have attachments, they will be merged into the master record. Note that there may be a short delay before the attachment appears in the merged record.

Additional Resources

Related Help Articles

Related Blog Posts