The Microsoft Dynamics 365 CRM (Sales and Service) integration brings your Dynamics 365 contacts and leads into Iterable as user profiles. Use it to keep Iterable profiles in step with your CRM, and to let each record's email opt-out in Dynamics 365 control the user's Iterable email subscription. For example, you can start a nurture journey when sales adds a lead, tailor messages to what your CRM knows about each lead, and move a lead into onboarding when they become a contact.
NOTE
This article covers the Integrations Hub integration for Microsoft Dynamics 365 CRM (Sales and Service). To export Microsoft Dynamics 365 Customer Insights segments to Iterable, read Microsoft Dynamics 365 Customer Insights + Iterable Integration.
# In this article
# How the integration works
The integration reads Dynamics 365 change tracking for the Contact and Lead tables and writes what changed to Iterable:
- Dynamics 365 contacts become Iterable user profiles.
- Dynamics 365 leads become Iterable user profiles. When a lead is qualified into a contact, their profile merges into the contact's profile. To learn more, read How qualified leads are handled.
- Each record's Do not allow Emails setting (
donotemail) controls the user's subscription to the Iterable email channel you choose. Other marketing channels can follow a Yes/No column that you choose.
After it imports existing records, the integration keeps checking Dynamics 365 for changes. Data flows one way: changes made in Iterable, including unsubscribes, aren't written back to Dynamics 365.
The integration syncs only the columns you map, plus the fields it sets itself. For the fields, see Field mappings.
# How users are matched
The Primary Identifier on the Iterable connection sets how the integration identifies users. You don't select it separately for Dynamics 365.
| Primary Identifier | Dynamics 365 identifier | Iterable identifier | Supported Iterable project types |
|---|---|---|---|
Record's email address (emailaddress1) | email | Hybrid, email-based | |
| User ID | Contact ID or lead ID |
userId, plus email when the record has one* | Hybrid, userID-based |
* In a hybrid project, email must also be unique. If another Iterable user
already has the record's email address, Iterable rejects that update. When a
contact and a lead share an email address, Iterable rejects the record that
syncs second. Within each sync, contacts sync before leads.
Choose the Primary Identifier that matches how your existing Iterable users are identified:
Select User ID if your users'
userIdvalues are Dynamics 365 contact and lead IDs, or if the project has no users yet and you want to identify all synced users by Dynamics 365 record ID. The integration also adds the record'semailto the user profile when the record has one. Not available for email-based projects.Select Email if your users are identified by
email, or byuserIdvalues that aren't Dynamics 365 record IDs. The integration skips records without an email address, and it doesn't mark records deleted in Dynamics 365. When a contact and a lead have the same email address, they update the same Iterable user, and the lead's values replace the contact's. Not available for userID-based projects.
To learn more about project types, read Project Types and Unique Identifiers.
# How existing records are imported
The integration imports all contacts, then all leads, that were created or changed on or after the Backfill Start Date. The import starts when you finish setup. Qualified leads aren't imported. Records last changed before the start date aren't imported, but they sync the next time they change in Dynamics 365.
Ongoing syncing starts when the import finishes.
The import runs again when you change any of these settings and select Finish:
- Backfill Start Date
- A field mapping
- A consent column on Consent Mapping
- The Primary Identifier on the Iterable connection
# How email consent syncs
The Iterable email channel you choose on Sync Settings follows each record's Do not allow Emails setting:
- On the first sync, Iterable unsubscribes every synced user whose record has Do not allow Emails set.
- After that, Iterable unsubscribes the user from the channel when Do not allow Emails is set on a record, and subscribes them again when it's cleared.
On Consent Mapping, you can have other marketing channels follow a Yes/No column that exists on both the Contact and Lead tables. When the column is Yes, Iterable unsubscribes the user from that channel. When it changes back to No, Iterable subscribes them again.
Only marketing channels are available. Transactional channels aren't listed, because users can't unsubscribe from them.
# How qualified leads are handled
When a lead is qualified into a contact, Iterable merges the lead's profile into the contact's profile and stops syncing the lead. When a lead is qualified without creating a contact, it stops syncing the lead.
# How deleted records are handled
Iterable doesn't delete user profiles. With user ID as the primary identifier, when a synced contact or lead is deleted in Dynamics 365, Iterable keeps the user's profile and sets these fields on it:
-
dynamicsDeleted: Set totrue. -
dynamicsDeletedAt: When the integration recorded the deletion.
With email as the primary identifier, the integration doesn't mark deleted records in Iterable.
# What isn't synced
The integration doesn't sync:
- Columns you don't map on Field Mapping, other than the fields the integration sets itself.
- Qualified leads. After a lead is qualified, the integration stops syncing them, and the import of existing records skips them.
- Records last changed before the Backfill Start Date, until they change again.
- Records without an email address, with email as the primary identifier.
- Subscription changes made in Iterable. They aren't written back to Dynamics 365.
- Deletions, with email as the primary identifier.
- Deletions that happen while change tracking is unavailable. The integration doesn't mark those records deleted.
- Other Dynamics 365 tables, such as accounts and opportunities.
# Connection requirements
To connect Microsoft Dynamics 365 to Iterable, you need the following from Microsoft Dynamics 365:
- Microsoft Dynamics 365 CRM (Sales and Service), with change tracking turned on for the Contact and Lead tables.
- A Microsoft Dynamics 365 account to authorize the connection.
- A field to identify the user that matches in Iterable:
- If you use email as the primary identifier, an email address on every Dynamics 365 contact and lead.
- If you use user ID as the primary identifier, a Dynamics 365 contact ID or lead ID that matches your Iterable user IDs. Records don't need an email address.
And you need the following from Iterable:
- A marketing email channel in the Iterable project.
- Iterable's Subscriptions API enabled for your organization. The API manages user subscriptions to message channels, message types, and email lists. Organizations created after September 2019 have it on by default. If your organization was created before September 2019, talk to your Iterable customer success manager to enable it.
- A server-side API key for the Iterable project that receives the data.
# Connecting Microsoft Dynamics 365 to Iterable
In Iterable, go to Integrations > Integrations Hub.
Find Microsoft Dynamics 365, select Connect, and then select Add Connection.
On Connections, authorize your Microsoft Dynamics 365 account. Then enter your Iterable API key and set Primary Identifier to the option that matches how your Iterable users are identified. See How users are matched.
-
On Sync Settings:
- Under Backfill Start Date, choose the earliest date to import. The integration imports contacts and leads created or changed on or after this date. The date can't be in the future. See How existing records are imported.
- Under Email Channel, select the Iterable marketing email channel that follows Do not allow Emails. See How email consent syncs.
On Field Mapping, map Dynamics 365 columns to Iterable fields on the Contacts and Leads tabs. See Field mappings.
-
Optionally, on Consent Mapping, have other marketing channels follow a Yes/No column:
- Under Iterable Channel, select the channel.
- Under Dynamics 365 Opt-Out Column, select a Yes/No column that exists on both the Contact and Lead tables.
To stop a channel from following a column, set Dynamics 365 Opt-Out Column to Not Synced or remove the row. If the project has no other marketing channels, the page says so and there's nothing to map.
On Validation, review the summary of what syncs, and then select Finish. If something needs fixing, Validation lists the problem and you can't finish until it's resolved. See Finishing setup is blocked by a validation problem.
In Dynamics 365, create or update a contact that has an email address. After the import finishes, open the matching user profile in Iterable and check for the mapped fields, such as
firstName, and fordynamicsRecordId.
# Field mappings
The Field Mapping page has a Contacts tab and a Leads tab. Each tab
has a mapping table, which starts with firstname mapped to firstName and
lastname mapped to lastName.
- Dynamics 365 Column: Select a column on the Contact or Lead table.
- Iterable Field: Enter the destination field name on the user profile.
- Add a row to sync another column.
- Edit Iterable Field to rename a destination field.
- Remove a row to stop syncing that column.
Each Dynamics 365 column maps to one Iterable field per tab. If you map the same column in more than one row on a tab, the later row replaces the earlier one. When a mapped column is empty in Dynamics 365, the integration clears the Iterable field.
The Dynamics 365 Column dropdown lists the table's readable columns, including custom columns, of these kinds: text, whole and decimal numbers, currency, dates, Yes/No, choices, and lookups. A choice column sends its label, and a lookup column, such as an owner, sends the name of the related record.
The Customizable column in each table shows whether you can change the row. Yes means you can change the Dynamics 365 column, rename the Iterable field, or remove the row. No means the integration always sets the field. These rows don't appear on Field Mapping, and you can't use their Iterable field names in your own mappings.
# Contact mappings
Contacts use the following mappings by default.
| Dynamics 365 column | Iterable field | Type | Customizable |
|---|---|---|---|
contactid | dynamicsRecordId | string | No |
contactid |
userId* | string | No |
emailaddress1 |
email* | string | No |
firstname | firstName | string | Yes |
lastname | lastName | string | Yes |
| Table name |
dynamicsRecordType* | string | No |
Notes:
-
dynamicsRecordType: Alwayscontact. -
email: Identifies the user when you use email as the primary identifier. When you use user ID as the primary identifier, the integration also adds it when the contact has an email address. -
userId: The integration uses it only when you use user ID as the primary identifier.
# Lead mappings
Leads use the following mappings by default.
| Dynamics 365 column | Iterable field | Type | Customizable |
|---|---|---|---|
emailaddress1 |
email* | string | No |
firstname | firstName | string | Yes |
lastname | lastName | string | Yes |
leadid | dynamicsRecordId | string | No |
leadid |
userId* | string | No |
| Table name |
dynamicsRecordType* | string | No |
Notes:
-
dynamicsRecordType: Alwayslead. -
email: Identifies the user when you use email as the primary identifier. When you use user ID as the primary identifier, the integration also adds it when the lead has an email address. -
userId: The integration uses it only when you use user ID as the primary identifier.
# Troubleshooting
# Finishing setup is blocked by a validation problem
Validation lists the problem and you can't finish until it's resolved. For example:
- Backfill Start Date is missing or in the future.
- No Email Channel is selected on Sync Settings.
- No column is mapped on either the Contacts or Leads tab.
- A mapping row has no Dynamics 365 column or no Iterable field.
- Two rows on the same tab use the same Iterable field.
- A mapping uses an Iterable field that the integration sets itself, such as
email,userId, ordynamicsRecordId. - A Consent Mapping row uses the email channel, which already follows Do not allow Emails.
- A channel is mapped more than once on Consent Mapping.
- A Consent Mapping column isn't a Yes/No column on both the Contact and Lead tables.
# Nothing syncs right after setup
The import of existing records is still running. Ongoing syncing starts when it finishes.
# Syncing fails because change tracking isn't turned on
The integration can't sync a table without change tracking. Turn on change tracking for the Contact and Lead tables in Dynamics 365. See Microsoft's change tracking documentation.
# Syncing fails because Dynamics 365 authentication failed
The integration can't reach Dynamics 365 because the connection's authorization no longer works. Syncing fails with "Dynamics 365 authentication failed; reconnect the Dynamics 365 connection." Reconnect the Dynamics 365 connection and authorize your Microsoft Dynamics 365 account again.
# Some contacts or leads don't appear in Iterable
Check whether the record:
- Has an email address, if you use email as the primary identifier.
- Was created or changed on or after the Backfill Start Date.
- Is a qualified lead. Qualified leads don't sync.
- Shares an email address with another contact or lead, in a hybrid project with user ID as the primary identifier. Iterable rejects the record that syncs second. See How users are matched.