Deduplicate HubSpot Companies and Salesforce Accounts

How to Merge Duplicate Salesforce Accounts and Merge HubSpot Companies to Match

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.  

Merge Duplicate Salesforce Accounts

Start by going through the standard deduplication steps for Salesforce accounts using the Merge Duplicates module.

Step 1: Find Duplicates

In the Merge Duplicates module, 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 the exact same Website, AND similar Account Names.

Find Duplicates Salesforce accounts

Choose fields that, in combination, give a high degree of certainty that the matched records are duplicate records.

Commonly used matching fields in Salesforce account deduplication include:

  • Account Name
  • Website
  • Phone Number
  • Billing Address

When finished, click the Find button and Insycle will generate a list of duplicates for you to review.

Step 2: Analyze the Identified Duplicates

Records that have the same values in the fields specified in Step 1 are considered matches. When two or more records represent the same company based on your matching rules, they are clustered together into duplicate groups.

Under Step 2, each row represents a duplicate group and shows the total number of records that matched your settings in each duplicate group. For example, if you had four records for the same Website, it would count as one duplicate group with four duplicate records.

Click the checkbox at the left end of a row to expand the duplicate group and view the records.

Review duplicate groups

Explore the record data in the duplicate groups, double-checking that the fields you set up in Step 1 are showing what you expected.

Looking at the record details in several duplicate groups, decide the best way to determine which is the master record the other records will be merged into. Learn more about common practices for picking a master record.

Add more columns to the view using the gear button on the right to get more context and analyze the records.

Click gear to add columns

Step 3: Choose Bulk Mode

The most efficient and sustainable way to merge duplicates is in Bulk mode. This allows you to set rules for determining the master record automatically across all records in your database. With Bulk mode, you'll be able to use saved templates and recipes to repeat the process on a regular basis. 

Under Step 3: Choose Operation, the Bulk mode tab is automatically selected. Leave this as is.

Step 3 Bulk option

If you have duplicate groups containing more than five records, you may want to change the value in Skip duplicate groups with more than 5 records per group to ensure you can get them all.

Note: When merging in bulk, Insycle limits the duplicate group size to 5 and skips groups that contain more records. This is a precaution to ensure that if you use a duplicate matching filter that is too broad in Step 1, you do not accidentally merge many non-duplicate records together. You can adjust the default value of 5 as needed, up to 100 per duplicate group. 

If you want granular control over which records are merged together, click the Manual tab. This will allow you to select the records to merge, one by one. Manual mode should be reserved only for cases where you need a careful, controlled process. Learn more about Manually Merging Duplicates.

Step 4: Set Master Record Selection and Data Retention Rules

Configure Rules to Automatically Select the Master Record

Now you’ll define how all of the matching duplicate groups should be merged at scale. To do this, you need to create a series of rules that specify which record from each group should become the master.

The master is the record that will remain after the merge. For example, if you had four records representing the same account, they would make up one duplicate group with four records, all of which would be merged into one master record. The other three records would be deleted.

Under Step 4, for most merge duplicate configurations you should select Priority Match in the header. With Priority Match, as soon as a record meets one of the criteria, Insycle makes the master selection and skips the rest of the rules on the list. 

With Absolute Match, the master record must meet all of the listed rules in the Record tab. This is appropriate for less flexible master selection. Learn more about Priority Match vs. Absolute Match in the Advanced How-Tos section below.

Select Priority Match

For the first rule in the list, on the Record tab 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 Selection 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 matches one rule will be selected as the master record, and further criteria won’t be analyzed.

Continue adding fields and conditions that could help differentiate a master record from duplicates that should be merged.

Master selection rules for Salesforce accounts

When run, if none of the records in the duplicate group match any of the rules, the automatic master selection for the group fails. See the Troubleshooting section below for more detail.

Configure Rules That Determine Values to Keep

After Insycle has identified the master record, it will use the Field selection rules to automatically pick which values from a duplicate group will be used in the master record. It's important to remember that the Fields tab is a set of rules for automatically selecting what data to keep. You separately need to configure the rules for automatically selecting the master record in the Record tab.

Under Step 4, click the Fields tab. For each field you want to control the data retention for, you need to select a Field, and tell it 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 is deleted.

The Criteria dropdown gives you several options for choosing the data to keep. For example, you could choose to keep the Account Name value from the record in the duplicate group that doesn't have numbers, while keeping the Ownership value from the most recently modified record in the group. Learn more about the Field selection criteria in the Advanced How-Tos, below.

Set rules to keep field data

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

Once you think you have all your Record and Field rules set, continue on to the Preview Changes then Apply to the CRMs section below to run a preview and see how it goes.

Merge Duplicate HubSpot Companies

Then set up the Merge Duplicates module to deduplicate HubSpot companies using the Salesforce Account ID to determine the master record.

Step 1: Find Duplicates

In the Merge Duplicates module, select the HubSpot database and Companies 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 company records that have the same Company Name, AND Company Domain Name.

Find duplicate HubSpot companies

Choose fields that, in combination, give a high degree of certainty that the matched records are duplicate records. 

Commonly used matching fields in HubSpot company deduplication include:

  • Company Name
  • Website URL
  • Company Domain Name
  • Phone Number

When finished, click the Find button and Insycle will generate a list of duplicates for you to review.

Step 2: Analyze the Identified Duplicates

Records that have the same values in the fields specified in Step 1 are considered matches. When two or more records represent the same company based on your matching rules, they are clustered together into duplicate groups.

Under Step 2, each row represents a duplicate group and shows the total number of records that matched your settings. For example, if you had four records for the same company, it would count as one duplicate group with four duplicate records.

Click the checkbox at the left end of a row to expand the duplicate group and view the records.

Review duplicate groups

Explore the record data in the duplicate groups, double-checking to ensure that the fields you set up in Step 1 show what you expected.

Looking at the record details in several duplicate groups, decide the best way to determine which is the master record the other records will be merged into. Learn more about common practices for picking a master record.

Add more columns to the view using the gear button on the right to get more context and analyze the records.

Click gear to add columns

Step 3: Choose Bulk Mode

Under Step 3: Choose Operation, the Bulk mode tab is automatically selected. Leave this as is.

Choose Bulk operation

If you have duplicate groups containing more than five records, you may want to change the value in Skip duplicate groups with more than 5 records per group to ensure you can merge them all.

Step 4: Set Master Record Selection and Data Retention Rules

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 that is synchronizing with Salesforce will have the Salesforce Account ID, the presence of this value can be used to identify the correct HubSpot record to choose as the master.

Under Step 4, select Priority Match in the header.

Select Priority Match

For the first rule in the list, on the Record tab set 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.

Set Salesforce Account ID master selection rule

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

Remember: The Fields tab is a separate set of rules for automatically selecting what data to keep. You still need to configure the rules for automatically selecting the master record in the Record tab.

For each field, you want to control the data retention for, specify which of the duplicate records data should be taken from. This is merged into the master. Any data that is not in the master or not copied to the master is deleted.

The Criteria dropdown gives you several options for choosing the data to keep.

For example, you could choose to keep the Number of Employees value from the record in the duplicate group with the highest number, while keeping the Company Owner value from the earliest created record in the group. Learn more about the Field selection criteria in the Advanced How-Tos, below.

Set rules for field data to keep

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

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

Preview Changes then Apply to CRMs

Step 5: Preview Deduplication Changes then Apply Merge to CRM

Preview Merges in CSV Report

After you have the deduplication rules set up, 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 5, click the Review button and select Preview mode.

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

Run Preview now

Insycle will generate a preview CSV and send it to your email. Open the CSV file from your email in a spreadsheet application.

Example CSV file

In the CSV, the Result column identifies which records were picked as the master and which were identified as duplicates and merged into the master. You'll see the values:

  • Duplicate – The record is part of a duplicate group.
  • Master The master record that was chosen for the duplicate group based on your rules.
  • Master (After) – For each duplicate group, the Result column will show the data the final record will contain, based on master selection and field data retention settings.
  • Error – If Insycle was not able to determine which record would be the master, an error message will appear here. See the Troubleshooting section below for more detail.

When a field value in the CSV says "(Default)," it means that the CRM will be using its default processes for dealing with the field. This is typically done for blank fields, system IDs, and other specific situations.

If everything in the Result column looks correct, 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, you should use Run Now the first time you apply these changes to the CRM.

Update CRM records now

Save Templates and Setup Automation

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 with Insycle templates, or on the HubSpot side, integrate with Workflows.

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

Under Step 5, click the Review button, and select Update mode.

On the When tab, select Automate, and configure the frequency you'd like the template to run. When finished, click Schedule.

Automate template

Advanced How-Tos

Step 4: Priority Match vs. Absolute Match

Priority Match and Absolute Match options

For each duplicate group, Insycle will look at each master selection rule to see which of the records in the group meet the criteria. At the right end of the Step 4 header, there are two different master selection options:

Priority Match: Looks through the master selection rules in order, one by one. As soon as a record meets one of the criteria, Insycle makes the master selection and skips the rest of the rules on the list. The vast majority of duplicate templates should use Priority Match.

Absolute Match: The master record must meet all of the listed rules in the Record tab in Step 4. If a record does not match every rule listed, no master record will be identified. Absolute Match is appropriate for less flexible master selection.

For example, if a company wanted to ensure the chosen master record is in their sales pipeline and already has a sales rep working the record, they can choose Absolute Match and set the Record rules:

  • Customer Priority is "High"
  • Account Owner exists

Choosing Absolute Match can often result in no master record being identified since the record has to match every rule listed, so in most cases, you should select Priority Match.

Step 4: Setting Rules for Field Data Retention

The Fields tab lets you set up rules that determine which data from the duplicate group should be preserved in the master record.

Configure rules for data to keep

The Criteria dropdown gives you several options for choosing the data to keep:

  • From master record – Use the value that exists in the master record.
  • From record where value – Select data from one of the records in the duplicate group based on the values. These options vary depending on the field type. For example, retain the data from the Number of Employees field that has the highest value.
  • From record based on other field value – Look at the value in a different field to decide which value from the duplicate group should be kept. The example above highlights how a Create Date value can be used to determine which Company Owner value from the duplicate group was created first.
  • Combine and append all values – You can merge the values from the selected field for all records in the group. For example, if there is some type of Notes field, you could keep the notes from all of the records in the duplicate group.
Step 4: Adding Extra Fields to Your CSV Export

When in doubt about what will wind up in your master records after the merge, add the important fields as additional rules on the Record tab. Then use the Preview CSV created in Step 5 to review how the values will merge.

Adding fields to master selection rules

Need More Control Picking Duplicate Records?

For situations where you need more granular customization for picking duplicate records to include—or exclude—from the deduplication process, you can customize bulk deduplication using exclusions and pre-defined masters. Additionally, you can use this process when there are no common rules you can apply to choose the master record.

Separately, it is also possible to customize the merge logic behavior. For example, you can instruct Insycle to copy values from field A to field B as part of the merge, or combine multiple fields into one. Customized merge logic requires an Enterprise plan. Please reach out to our support team via chat to discuss your specific requirements.

Troubleshooting

Duplicates Not Appearing Under Step 2

Most of the time when Insycle can't find duplicates, it is due to your matching rules in Step 1. To better understand how to set up your rules, it is important to analyze the underlying data. A useful exercise can be to set up a simple filter to look for exact matches of Website, or Company Domain Name.

Step 1: Find duplicates

When you click the Find button, the results can show you a broad overview of what duplicates are potentially in your database, and what fields might be useful to include in your Find setup. 

To get more information, click the gear button on the right side of the Step 2 header. Here, you can add any field in your database as a column to the Review Duplicates list to better understand the data inside these records.

Gear button

"Cannot Determine Master Record" Result in CSV

If the Result column of the CSV displays an error, read the error text for help figuring out how to resolve the problem.

The most common error is:

Cannot determine master record because multiple records (#) satisfy the master selection rules. In ‘Master Selection’, change/add/reorder the rules such that only one record satisfies them (if cannot determine master based on field values, use ‘ID is lowest’ as the last rule).

CSV export showing error

This means that based on all the rules, Insycle could not figure out which record in the duplicate group would be the master. None of the records meet more of the rules than others.

There are a couple of things you can try to resolve this:

  1. Under Step 4, experiment with reordering or adding additional fields that are likely to have unique values.
  2. In the Step 4 heading, check to ensure that you have Priority Match selected and not Absolute Match.
    With Priority Match, your master record only has to match one rule. Using Absolute Match, your master record would have to meet all of the rule criteria. The majority of the time it is best to select Priority Match.
    If Priority Match was used, then none of the records in the duplicate group meet any of the criteria on the list more than the others. In this case, you'll need to experiment, reordering or adding additional rules for fields likely to have unique values.

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 and merge companies within the HubSpot application, it won'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. 

Additional Resources

Related Help Articles

Related Blog Articles