Conditional Mapping: Connecting Multiple Hubspot Portals to Salesforce

This article will show you how to configure your Formstack Sync to integrate multiple HubSpot instances with a single Salesforce portal.  The techniques shown here can be used to connect any other marketing automation system with any other sales CRM.  We'll be integrating companies, contacts, and activities in this example.  Records will sync between each HubSpot portal and Salesforce, but will  not be integrated between the two HubSpot portals; each HubSpot portal will maintain its own independent data set and configuration.

As always, our onboarding and support team are available to give you a hand with your setup. 


Configure Your Systems

Add Custom Fields to All Objects

  • To ensure that data remains correctly siloed and moves correctly around your integration, you'll need to add custom fields to your company and contact records in both HubSpot portals and in Salesforce.  In this example, we've added the field "HubSpot Region" to the following objects:
  • Salesforce Contacts
  • Salesforce Leads
  • HubSpot (portal 1) Contacts
  • HubSpot (portal 2) Contacts
  • You'll also want to populate these fields on all existing records in the HubSpot portals.  In this example, HubSpot (portal 1) is based in North America, while portal 2 is based in the EU.


Connect Your Portals

  • Navigate to
  • Connect your Salesforce instance, following these directions.
  • Connect your first HubSpot instance, following these directions.
  • Use the "Install a new connector" modal to add your second HubSpot instance, following the same directions.
  • When your portals are correctly connected, you'll see a block for Salesforce and for HubSpot.  Clicking the "Installed" button on HubSpot will reveal two HubSpot connections, hubspot0 and hubspot1.
  • It's good practice to write down which HubSpot portal is which.  As mentioned, hubspot0 holds data from North America and hubspot1 holds data from the EU.


Add Contact Mappings

You'll need to add two contact mappings, one between hubspot0 (HubSpot North America): Salesforce and a second between hubspot1 (HubSpot EU): Salesforce.

Contact Mapping - HubSpot North America

Map Your Fields

  • Navigate to
  • Click one of the blue "+ Add Mapping" buttons.
  • A modal will pop up.  Select "Contact Mapping" from the "Data Type" drop-down menu.  Add a title that indicates which systems are being connected.  Click "Save".
  • An empty contact mapping will be created.  There will be an error message telling you that you need to review this mapping; don't worry, we're getting there!  Click anywhere on the mapping to enter the edit screen.
  • On the edit screen, click on one of the blue "+ Add Field" buttons to start adding fields.
  • Since we're working with the North America mapping, you'll want to be sure to select only fields from hubspot0 and salesforce0.  This is a sample mapping for contact first name.  Additional field mappings should follow this same pattern: first the Salesforce contact, then Salesforce lead, then the hubspot0 contact.
  • Repeat for Last Name and Email.
  • Add a mapping for HubSpot region, as below.  You must map this field for conditionals to work correctly.  This will ensure that all accounts created in Salesforce are linked to the correct HubSpot portal.
  • You can add as many other field mappings as you need, but make sure to only map fields between hubspot0 and salesforce0. Disregard the warning to include hubspot1 email field.
    Did you know?  You can change your System of Record on a field-by-field level, giving you granular control over which system controls the value in which field.  For example, you probably want your sales CRM to control fields like name and contact information, but you will want to make sure that your marketing system is the System of Record for any fields like lead score or number of visits.

Map Your Relationships

  • Navigate to the "Relationships" tab and click one of the blue "+ Add Relationship" buttons.
  • In the modal that appears, map relationships for owner and company as below.  Make sure to only include hubspot0 and salesforce0 in this mapping.

Add Your Conditions

  • Click the "conditions" tab at the top of the screen, then add conditions as below.  Click "Save."
  • Set conditions as below.

Contact Mapping - HubSpot EU

  • Repeat all steps above for Contact Mapping - HubSpot EU, but use only hubspot1.  Change all region default values and conditions from North America to EU.


Add Activity Mappings

You will need to add three mappings to fully integrate your activity data: one from hubspot0 to Salesforce, one from hubspot1 to Salesforce, and one from Salesforce to both HubSpot portals.  While the Salesforce > HubSpot Activity mapping might look like it will add records to both HubSpot portals, HubSpot requires that activity records are attached to contact records.  These contacts will follow the creation rules in the contact mapping, so your data will still be kept separate.

Did you know?  Each record can only pass through one mapping, and you can only set up mappings based on fields that exist on that object.  (Pssst.  There's a way to get around this requirement.  Check it out here.)  This means that in order to properly handle all mappings, we need to set one up for each of the HubSpot portals separately, as well as a third to handle activities that originate in Salesforce.

Activity Mapping - HubSpot North America

Map your Fields

  • An activity mapping always requires two fields: subject and "occurred at" timestamp.  Salesforce also requires that the "Priority" field be populated in order to create an activity.  Set up your fields between hubspot0 and salesforce0 as in the screenshots below.  Make sure to enter the default value "Normal" for Salesforce Priority.

Map your Relationships

Activity relationships are mapped between several different objects--owner, company, opportunity, and contact.  You still want to make sure that relationships are only configured between hubspot0 and salesforce0, but the fastest way to set these up is to auto-map them and then delete the references to hubspot1.  Don't worry, we'll walk you through this.

  • Click through to the "Relationships" tab at the top, and then click the "Auto-Match Relationships" button.
  • Formstack Sync will automatically identify and add all the necessary relationships, but we add these relationships between ALL of your connected systems.  We only want to connect hubspot0 and salesforce0.
  • Fixing this is easy.  Click into each of the blocks and click the X under "Remove" for the hubspot1 row in all of them, then save.
  • When you're done, your relationships screen should look like this.  Not a hubspot1 in sight!

Add your Conditions

This mapping will transfer activities created in HubSpot-North America to Salesforce.

  • Click through to the "Conditions" tab and set the condition to "hubspot0 has a engagement where any field is not empty."  Save it and you're all set!


Activity Mapping - HubSpot EU

This mapping is configured exactly the same as HubSpot North America.  Just substitute hubspot1 for hubspot0 at every step, and you've got it.

Activity Mapping - Salesforce

Map your Fields

Now, we'll add a mapping that will transfer all activity from Salesforce to the correct HubSpot portal.  The field mappings are almost identical to above, but you're going to include all three portals.

  • Add a new activity mapping and name it "Activity Mapping - Salesforce".
  • Add mappings for subject and reminder date/time, as below.  Again, everything is just the same as in the HubSpot mappings, but you're going to include both hubspot0 and hubspot1.
  • Add the "Priority" field mapping for Salesforce only.  Remember to set the default value to "Normal".

Add your Relationships

  • For this mapping, you can just hit the "Auto-Map Relationships" button.  No muss, no fuss, don't need to change a thing.

Add your Conditions

This mapping is only going to transfer activity data out of Salesforce.  It will automatically add activity to the right portal, since activities must be attached to a contact, which the earlier mappings took care of.

  • Click through to the "Conditions" tab and set the condition to "salesforce0 has a task where any field is not empty."


Add a Workflow

While you don't need to take any action in this step, it's a good idea to check and make sure that you have a Default Workflow set up.  

  • Navigate to
  • Verify that there is a Default Workflow set up and enabled.  Look for the little green block that says "Enabled" under the workflow title.
  • You can click into the workflow to verify that it is configured to "If ANY of the following conditions are met: any connector has a record where any field is not empty."  If so, you're all set.  If not, you may want to reach out to our support team to make sure that everything is set up correctly.

Activate Your Sync

Nice work!  Now that you've gotten all of your mappings set up, you can go ahead and turn on your sync.

  • Head back to the Dashboard tab and toggle the "Integration Status" button in the top left to "ON".  It will turn green, as below.
  • A modal will appear that asks whether you want to sync future changes only, or sync past and future changes.  Talk to our support team about what's right for your organization; we usually recommend to sync future changes only.  Click the "Start" button in the bottom right.




  • The first thing that needs to happen before we can start updating your data is an index of all of your existing records.  Formstack Sync will scan your data behind the scenes to make sure that we know what you've already got in your databases.  This can take as little as a few hours or as long as several days to a week.  If you're wondering what your sync status is, contact our support team.



Once the initial indexing run is complete, you're all set to see your data start transferring.  Here's what to expect.

Data Transfer between HubSpot - North America & Salesforce

  • Add a contact to HubSpot North America.  Make sure to set the region to "North America."
  • After a sync run, this contact shows up as a Lead in Salesforce.
  • Notes left in HubSpot will automatically show up on the contact record in Salesforce.
  • Notes left in Salesforce will automatically show up on the contact record in HubSpot North America.

Data Transfer between HubSpot - EU & Salesforce

  • Add a contact to HubSpot - EU with the region set to EU, and after a sync run it will show up in Salesforce as a lead.
  • Notes added to this contact in HubSpot will transfer to Salesforce.
  • Notes added to this contact in Salesforce will transfer to HubSpot.

Data Transfer between HubSpot North America and HubSpot EU

  • Psych.  There isn't any.  Using this configuration will keep your HubSpot data completely separate from each other.


Key Takeaways

  • You can use this model to connect any number of instances of a connector.  Just make sure that you have a separate contact mapping for each "pair" you want connected, even if one system is represented in multiple pairs (as Salesforce is here).
  • No seriously: Don't cross the streams.  Don't set up any "primary" mappings (Contact, Company, Opportunity, Tickets) that include fields from two systems that you don't want to integrate.  Activity is the only exception here.
  • Make sure that there's a single field that you've created on all portals and all systems that carries essential data about which portal a record "belongs" to.  In this example, we used "HubSpot Region", but you might want to segment by salesperson, company size, or many other things.  It's best practice to make sure that this field is automatically populated in all systems where a record might originate.  Here, you should set up your HubSpot portals to make sure that all contacts have the region field automatically populated.
  • Make sure that the field you're using to create a condition is mapped.
  • Make sure that you've set up relationships for all mappings (but again, only between the two systems you're integrating).


Was this article helpful?
0 out of 0 found this helpful



Article is closed for comments.