Connect Microsoft Dynamics 365 to Docket Marketing Agents

The Microsoft Dynamics 365 integration carries visitor and conversation context into your CRM. Docket marketing agent can create a Lead when no active Lead or Contact matches the visitor's email, update matching records, and add Phone Call and Appointment activities.

What does the Dynamics 365 integration write

Docket marketing agent matches the visitor by email address, then writes to the records related to that person.

Dynamics record

What Docket does

Lead

Updates the first active Lead that matches the visitor's email. If no active Lead or Contact matches and Lead is turned on for the agent, Docket can create a Lead.

Contact

Updates the first active Contact that matches the visitor's email.

Account

Updates the parent Account of a matched Contact. Docket does not search Accounts independently using the visitor's email.

Opportunity

Updates up to 10 open Opportunities related to a matched Contact or the Contact's Account.

Phone Call

Optionally creates a Phone Call activity after a conversation.

Appointment

Optionally creates an Appointment when the visitor books a meeting through Docket.

A visitor email is required for CRM matching. If an active Lead and an active Contact share the same email, Docket can update both, as long as Lead and Contact are both turned on under Sync to Dynamics 365 for that agent.

What do I need before connecting Dynamics 365

Have these ready before you start:

  • A Microsoft admin to connect. Plan for a Microsoft Entra Global Administrator who also holds the System Administrator security role in your Dynamics environment. The next two sections explain why, and how to add the role.

  • Docket access for that admin. The connection is made in Docket Settings, so the admin needs a Docket account with the Admin role.

  • A cloud Dynamics 365 Sales environment. On-premises deployments are not supported.

  • Your Microsoft tenant ID for the Dynamics environment.

  • Your Dynamics domain. From the environment URL, take the part between https:// and .dynamics.com. For https://contoso.crm4.dynamics.com, that is contoso.crm4. You can find the URL in the environment details in the Power Platform admin center.

Who should connect Dynamics 365 to Docket

A Microsoft Global Administrator who also holds the System Administrator security role in your Dynamics environment should connect Dynamics 365 to Docket. You connect once for the whole workspace, and your reps never connect Dynamics themselves.

Docket uses the admin's sign-in during setup for two jobs, and each one needs one of these roles:

  • Approve Docket's access for your organization: A Global Administrator can approve the permissions Docket requests on behalf of everyone in your Microsoft tenant.

  • Create the Docket application user: Docket adds an application user to your Dynamics environment and assigns it three security roles: Salesperson, Sales Manager and System Customizer. Creating a user and assigning roles in Dynamics needs the System Administrator security role.

After setup, Docket writes to Dynamics 365 as the Docket application user, not as the admin who connected.

How do I give the admin the System Administrator role in Dynamics 365?

A Global Administrator adds the System Administrator security role to their own account in the Power Platform admin center, because Microsoft does not assign it to Global Administrators automatically. Do this before connecting, or skip these steps if the admin already holds System Administrator in the environment.

  1. Sign in to the Power Platform admin center as the Global Administrator who will connect Dynamics.

  2. Select Manage, then Environments.

  3. Select the Dynamics environment you plan to connect.

  4. In the command bar, select Membership.

  5. In the System Administrators pane, select Add me.

Microsoft describes this step in Manage high-privileged admin roles. If your organization uses Privileged Identity Management, Microsoft removes the role when the admin's activation expires, so connect Docket while the role is active.

How do I connect Dynamics 365 to Docket

Connect Dynamics 365 once for the whole workspace, from the Integrations tab in Docket Settings. Sign in to Docket as the admin from the previous section.

  1. In Docket, open Settings and select the Integrations tab.

  2. Find MS Dynamics CRM and select Connect.

The Apps and Integrations page in Docket Settings, with the Settings icon, the Integrations tab and the MS Dynamics CRM card highlighted
  1. Enter the Microsoft tenant ID and Dynamics domain, then select Connect.

The MS Dynamics CRM connection dialog with the Tenant ID field, Dynamics domain field and Connect highlighted
  1. Sign in to Microsoft with the admin's account. Review the permissions Docket requests and approve them for your organization. See Microsoft's permissions and consent overview.

  2. Return to Docket and wait for the integration card to show that it is connected.

The connected card confirms that Microsoft authorized Docket. Docket then finishes setup in your Dynamics environment in the background: it creates the Docket application user, assigns its security roles and adds the Docket custom fields. There is no managed solution file to import.

How do I check that Docket finished setting up Dynamics 365

Open the Docket application user in the Power Platform admin center after the card shows connected. The card confirms Microsoft authorization, and this check confirms that the rest of the setup finished.

  1. In the Power Platform admin center, select Manage, then Environments, and select the environment you connected.

  2. Select Settings, then Users + permissions, then Application users.

  3. Select the Docket application user, then select Details. It has the same name as the app on Microsoft's permissions screen in step 9. Confirm that the user is active and that Assigned security roles lists Salesperson, Sales Manager and System Customizer.

Keep these three roles on the Docket application user. Docket looks up Contacts before it creates or updates a Lead, so the application user needs to read Contacts even when only Lead sync is turned on.

If the Docket application user is missing or has fewer than three roles, give the connecting admin the System Administrator role with steps 1 to 5. Then, on the MS Dynamics CRM card in Docket, select the settings icon and select Disconnect. Connect again with steps 6 to 10.

Why can I not see the Docket fields in Dynamics

Because the custom fields Docket creates during setup are not added to a form or view automatically. A Dynamics administrator opens the relevant solution in Power Apps, adds the fields to the form or view, then saves and publishes the customization. Until then the fields exist in the underlying Dataverse schema but are invisible to CRM users.

How do I choose what Docket reads from Dynamics 365

Read access brings Dynamics records into Docket so an agent can use them mid-conversation. It is set on the integration card and is separate from the per-agent writeback settings.

  1. On the connected Dynamics card, select the settings icon, then select Settings.

  2. Under Data Access, review the Read setting for Lead, Contact, Account and Opportunity, then select Save.

Data Access settings for the Dynamics integration showing Read toggles for Lead, Contact, Account and Opportunity

How do I turn on Dynamics 365 sync for a Marketing Agent

The workspace connection makes Dynamics available. The agent-level switch decides whether that particular agent runs the Dynamics writeback.

  1. Open Marketing Agent Configuration and select the agent you want to configure.

  2. Open Analysis and Actions.

  3. Under Post Call Actions, turn on Sync to Dynamics 365.

The Analysis and Actions tab of a Marketing Agent, with the Marketing Agent Configuration icon, the Analysis and Actions tab, Post Call Actions and Sync to Dynamics 365 highlighted

How do I choose records and map fields

Expand a record type to review its saved field mappings and choose how each Dynamics field is updated.

  1. Enable Lead if the agent should update matching Leads, or create a Lead when no active Contact or Lead matches.

  2. Enable any other record types this agent should update.

  3. Expand a record type. In each row, choose a field under Docket Fields and the Dynamics field it writes to under Dynamics Fields. The Dynamics Fields dropdown opens with a search box, so you can type part of a field name instead of scrolling the whole list.

Dynamics field mapping rows pairing a Docket field with a Dynamics field
  1. Choose the mapping Behavior. Fill if empty writes the Docket value only when the Dynamics field has no value, and Overwrite replaces the existing value.

  2. Add or remove mappings as needed, then select Save.

Which Dynamics 365 fields can Docket write to

Docket writes values directly into Dynamics 365 columns, so map each Docket field to a column that can store that kind of value.

  • Numbers: map numeric post-call analysis fields to a Decimal number column. Docket sends numbers in decimal form, such as 25.0, which Whole number and Choice columns do not accept.

  • Lookup columns, such as Source Campaign: map text to a text column instead. A lookup column links to another Dynamics record, so it cannot store text from Docket.

  • Text length: keep values within the column's maximum length. The Lead Company Name column holds up to 100 characters.

When Dynamics 365 rejects the value for one column, Docket skips that column and still writes the rest of the record. A text value longer than the column's maximum length is the exception, because it can stop a new Lead from being created.

How does Docket fill First Name and Last Name on a new Dynamics 365 Lead?

Docket fills First Name and Last Name on a new Lead by looking up the visitor's email address. It does not use the name the visitor types in the conversation.

When the lookup finds no name, Docket leaves First Name empty. It fills Last Name, which Dynamics 365 requires on every Lead, with the part of the email address before the @. For example, tom.holland@example.com becomes a Last Name of Tom.holland.

To use the name the visitor gives in the conversation, create two post-call analysis fields that extract the visitor's first name and last name. Map them to the Lead's First Name and Last Name fields with the Fill if empty behavior. Creating Post-Call Analysis Fields explains how to set them up.

How do I log conversations and meetings as Dynamics activities

Docket creates activities related to each Lead or Contact updated during the writeback. Expand Docket Activity to turn them on.

Docket Activity settings offering the Phone Call and Appointment activity types
  • Phone Call creates a Phone Call activity after a conversation. Its description carries the conversation details and the transcript where available.

  • Appointment creates an Appointment when the conversation includes a Docket meeting booking. Docket adds the matching Dynamics user when the meeting owner's email belongs to an active Dynamics user.

  1. Enable the activities you need, then select Save.

Troubleshooting Dynamics 365 sync

What you are seeing

What to check

The connection does not complete

Confirm the tenant ID and Dynamics domain. Then confirm that the admin connecting is a Global Administrator who holds the System Administrator security role in that environment (steps 1 to 5).

Microsoft asks for admin approval during sign-in

The account signing in cannot approve Docket's access for your organization. Have a Global Administrator connect Dynamics instead.

The card shows connected, but Docket never updates any Lead or Contact

Check the Docket application user (steps 11 to 13). If it is missing or has fewer than three security roles, setup did not finish. Give the admin the System Administrator role, then disconnect Dynamics and connect it again.

Dynamics is connected, but the agent does not write

Confirm Sync to Dynamics 365 is on for that agent, the record type is enabled, the mapping is complete, and the configuration was saved.

No Lead or Contact is updated for a conversation

Confirm the conversation captured a visitor email and that the matching Dynamics record is active. Docket checks active Contact and Lead records independently.

No Lead is created for a conversation that captured an email

Check mapped text values against each column's maximum length. A value that is too long, such as a Company Name over 100 characters, can stop the Lead from being created.

Account or Opportunity is not updated

Confirm a Contact matched first. Account and Opportunity writeback follows the matched Contact's relationships.

A field is missing or a mapping is invalid

Refresh the agent configuration page, reopen Sync to Dynamics 365, then replace the invalid mapping and save again.

One mapped field stays empty in Dynamics

Check the Dynamics column type. Map text to a text column and numbers to a Decimal number column. Lookup, Whole number and Choice columns do not take Docket values directly.

A new Lead's Last Name is the start of the visitor's email address

Docket found no name for the visitor's email. Map first-name and last-name post-call analysis fields to use the name from the conversation.

No Appointment is created

Confirm the conversation produced a Docket meeting booking, that Appointment is enabled, and that Docket updated a Lead or Contact.

The Docket fields are missing from a Dynamics form

A Dynamics administrator has to add them to the form or view in Power Apps and publish the customization.

Frequently asked questions

Does a Microsoft admin need to connect Dynamics 365 to Docket?

Yes. A Microsoft Global Administrator who also holds the System Administrator security role in your Dynamics environment should connect it. Global Administrators do not get that role automatically, so add it first in the Power Platform admin center.

Does Docket support on-premises Dynamics 365?

No. Docket connects to a cloud Dynamics 365 Sales environment. An on-premises deployment cannot be used.

Do I need to import a managed solution into Dynamics?

No. After Microsoft authorization, Docket creates its application user and custom fields in the background. Check the application user afterwards with steps 11 to 13.

Can Docket create Contacts, Accounts, or Opportunities?

No. Docket can create a Lead. It updates Contacts, Accounts, and Opportunities only where a matching record already exists.

What happens if a Lead and a Contact share the same email address?

Docket can update both, as long as Lead and Contact are both turned on under Sync to Dynamics 365. It checks active Contact and Lead records independently.

How many Opportunities does Docket update?

Up to 10 open Opportunities related to the matched Contact or that Contact's Account.

What happens to my Dynamics 365 records if I disconnect Docket?

They stay in Dynamics 365. Disconnecting stops future syncing and updates through the integration. It does not delete the Leads and Contacts Docket already wrote or remove their relationships.

Do I have to connect Dynamics again for each agent?

No. Connect Dynamics once in Settings, then turn on Sync to Dynamics 365 for each agent that should write back.

Related articles

If you need help with your Microsoft Dynamics 365 integration, contact Docket Support.