How Bidirectional Syncs Work
This guide explains in depth how syncs work between Salesforce and Unify.
Overview
Unify can create and update Salesforce records in response to Play runs and sequence enrollments. This page summarizes the rules used to determine when and how to create or update records in Salesforce.
Configurable Settings
There are a few settings you can change in Unify to control whether and how Unify data is written back to Salesforce. All of these settings can be found in the Salesforce integration settings.
Enable Writing to Salesforce
By default, writing to Salesforce is disabled. You need to enable it by toggling the Enable writing to Salesforce option on:
Enable the toggle to allow Unify to write to Salesforce.
Use Contacts or Leads
Person records in Unify can be written back to Salesforce as either contacts or leads.
When writing contacts, the associated company is written as an account linked to the contact. When writing leads, however, the company information is stored directly on the lead object in the Company and Website fields.
By default, Unify writes contacts and accounts. You can change this by selecting an option in the settings dropdown:
Choose between creating contacts or leads in Salesforce.
Customize Mapping
You can customize the field mapping for each Unify and Salesforce object type. These mappings describe exactly which fields to read from Salesforce into Unify and which fields to write back from Unify into Salesforce when creating or updating records.
Choose an object type to customize its field mappings.
Once selected, customize the settings for each field individually.
Within each mapping, you can choose a mapping direction for each field:
- Read & Write: This field will be synced in both directions between Unify and Salesforce
- Read only: This Salesforce field will be read from Salesforce to populate records in Unify
- Write only: This Unify field will be written when creating or updating records in Salesforce
Behavior
Duplicates are strictly prevented within Unify. When creating new Salesforce records, Unify will only ever create one record. If there is already an existing Salesforce record of the same type, Unify will always update it rather than creating a new one.
However, duplicates are a common problem in Salesforce and may already exist in your Salesforce instance. In addition, users or other integrations may accidentally create new duplicates over time.
In order to accommodate this reality, Unify follows specific rules to ensure predictable behavior when updating duplicated Salesforce records. While Unify cannot de-duplicate your Salesforce, it will never make the problem worse, and in some situations may be able to help clarify the “source of truth” record.
Contacts
Salesforce contacts are written by Unify if Create new records as Contacts & Accounts is selected. In addition, contacts are sometimes created in place of leads if the person being written to Salesforce already exists as a contact. Unify cannot create a lead in this situation due to Salesforce’s contact duplicate rules.
In both situations, if there is an existing contact that matches the Unify person being written, it will be updated. Matches are determined based on email address. If there are no matches, a new contact will be created.
If there are multiple contacts that match the Unify person, only one will be updated. Specifically, the contact that was most recently modified within Salesforce is the one that will be updated.
Accounts
Salesforce accounts are written by Unify whenever a contact is created or updated. They are also written if a Salesforce sync action runs within a Play that is running on companies.
If there is an existing account that matches the Unify company being written, it will be updated. Matches are determined based on the domain of the company website. Domains are normalized, so URLs that redirect to different domains will not result in duplicates. If there are no matches, a new account will be created.
If there are multiple accounts that match the Unify company, only one will be updated. Specifically:
- If one account has more associated contacts than the other(s), that one will be updated
- Otherwise, the account that was most recently modified within Salesforce will be updated
Leads
Salesforce leads are written by Unify when Create new records as Leads is selected.
If there is an existing lead that matches the Unify company being written, it will be updated. Matches are determined based on email address. If there are no matches, a new lead will be created.
If there are multiple leads that match the Unify person, only one will be updated. Specifically, the lead that was most recently modified within Salesforce is the one that will be updated.
Email Messages
Unify writes to the email message object in Salesforce, which is the recommended approach for syncing email data to Salesforce. In order to write records of this object type, the Enhanced Email feature must be enabled in Salesforce. This is typically enabled by default.
Unify includes values for all of the standard fields on the email message object when writing records:
- Universal message ID: A globally unique identifier that exists for all email messages.
- Sender: A reference to the user, contact, or lead that sent the email.
- Recipients: A list of the users, contacts, or leads that received the email.
- Subject: The subject of the email.
- Content: The body of the email.
- Sent At: The date and time the email was sent.
- Is Bounced: Whether the email bounced.
In addition, Unify supports writing values to custom fields if you choose to create them:
- Bounced At: The date and time the email bounced.
- Click Count: The number of times one of the links in the email message was clicked by a recipient. Click tracking is powered by the Unify intent client installed on your website(s), which means that only links to websites where the intent client is installed will be tracked.
- Clicked At: The date and time that a link in the email was first clicked.
- Is Marked as Spam: Whether the email was marked as spam by a recipient. Keep in mind that Unify is not able to track this information consistently due to differences in how various email service providers handle spam.
- Marked As Spam At: The date and time the email was marked as spam by a recipient.
- Is Opened: Whether the email has been opened by a recipient.
- First Opened At: The date and time the email was first opened by a recipient.
- Last Opened At: The date and time the email was last opened by a recipient.
- Track Opens: Whether open tracking was enabled for this email. This setting can be configured within the settings page.
- Is Opted Out: Whether the recipient opted out of receiving emails.
- Opted Out At: The date and time the recipient opted out of receiving emails.
- Enrolled By Play: The Play that enrolled the recipient in the sequence.
- Sequence Name: The name of the sequence that this email is linked to.
Email messages are written to Salesforce for all emails sent as a part of Unify sequences if the corresponding person already exists in Salesforce. This means that in order to write email messages for sequence enrollments, you should ensure that the person already exists in Salesforce or that you include a Play action to sync them to Salesforce.