Templates / Sales / Sync Salesloft People to Hubspot Contacts
Sync Salesloft People to Hubspot Contacts
This workflow is a live sync between Salesloft People and Hubspot Contacts. It is triggered by any changes occurring in Salesloft, which are then synced to Hubspot.
It is set up to prevent duplicate notifications syncing in Hubspot and can be used for bi-directional syncing (if updates are made either in Hubspot or Salesloft).
It is designed to work in tandem with Sync Contacts Unidirectional Hubspot > Salesloft template or as a stand-alone unidirectional workflow (if updates are made in Salesloft only).
The following connectors are used in this template. This is provided for reference only - there is no need to read through the linked connector pages, as all you need to know for this template is explained here:
The image below shows a synced contact in Salesloft and Hubspot :
This workflow assumes the following:
You have API credentials set up with Salesloft and Hubspot.
(Optional but recommended) You have a custom field within Hubspot and Salesloft to hold the ID of the person/contact in the other system
In order to configure this workflow for use, simply:
The overall logic of the workflow is:
Section 1 The trigger waits for Salesloft to notify Tray of contact creation or update.
Section 2 First, the workflow checks if a Hubspot ID (Custom Field) is available in Salesloft Person details. If available, then it is used to get the contact details from Hubspot. If it isn’t available, a second check is performed (explained in section 3).
Section 3 If Hubspot ID is not found, a second check is performed using email address. If available, then it is used to get the contact details from Hubspot.
Section 4 If no match is found in Section 2 and 3, the workflow concludes that this person does not exist yet in Hubspot and creates a new Contact.
If the contact match has been found, the workflow compares the values for the contact against their respective matches coming from Salesloft and updates the contact information in Hubspot accordingly.
Add fallback value
The workflow uses a fallback value for the Has HS Id? step.
In this step, a null value is set as a fallback value for the 1st Value (Hubspot Contact ID) field.
This is necessary because if a field is empty in Hubspot, the API will return nothing at all, as if that field doesn't actually exist.
So a null value will be used if the Hubspot Contact ID is not found within the data received from the trigger and will save the workflow from failing.
Search contact details from Hubspot using Hubspot ID/Email.
To later decide within the workflow what action (create or update) needs to be taken in the Hubspot account, we need to know if the contact already exists in Hubspot.
If it exists, then the contact in Hubspot will be updated. If it doesn't, a new contact in Hubspot will be created.
The workflow requires the Hubspot ID or an Email address from the data received through the trigger to find the contact. If any one of these attributes exists in the trigger data:
The workflow searches for the contact in the Hubspot using it.
The contact details are then stored using data storage in the workflow's Set Contact step. Which are later fetched for further processing in the Get Contact step.
If none of the mentioned attributes is found, then the workflow terminates.
Build and compare HS and SL payload
Before updating the data in Hubspot, the workflow compares the new data received through Salesloft with the existing data from Hubspot.
If there is no difference between them, the workflow ends without performing any action. If a difference is found, the workflow updates the new information in Hubspot.
To do so, you need to create Salesloft and Hubspot payload by:
Choosing the fields you wish to be part of the payloads. Refer to Choose fields in the Getting live section.
Convert SL/HS ID type: converts the Hubspot and Salesloft IDs data type to number.
This will help ease the comparison of the Hubspot and Salesloft IDs in the Compare Payload to Payload step.
Build SL/HS Payload step: creates separate objects of key/value pairs for Hubspot and Salesloft fields using the Add key/value pairs operation.
This operation adds key/value pairs from the array list to a source object as properties and then returns a single object.
Compare Payload to Payload: The payload objects are then compared using the Equals operation.
The operation returns true if both the objects are the same, false otherwise.
Section 1: Get Salesloft people details
Section 2: Search Hubspot contact details using HS ID
(Has HS ID? - True Branch)
Section 3: Search Hubspot contact details using Email
(Has HS ID? - False Branch)