> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ada.cx/llms.txt.

# Configure the Microsoft Dynamics 365 handoff

After you complete the [initial configuration](/docs/handoffs/microsoft-dynamics-365/initial-configuration) and share your credentials, your Ada team installs the integration. When that is complete, the **MS Dynamics Ticketing** app appears in **Config → Apps** in your AI Agent dashboard, and you can configure the handoff.

> **Info**
>
> Your Ada team will complete the installation step during the integration setup. Contact your Ada representative to confirm when this step is finished before proceeding.

## Connect the app

The app needs your Dynamics 365 credentials before the **Create Ticket** block can create Cases.

**To connect the MS Dynamics Ticketing app:**

1. In your AI Agent dashboard, go to **Config → Apps**.
2. Find **MS Dynamics Ticketing** and click **Connect**.

![The MS Dynamics Ticketing app in the Apps list with a Connect button](/_fern-files/_img/1d4b65c6fb1103b4d549e07de0d217d2cae0070dd79da8b99df3a4bdb0d10602.webp)

3. Enter the values from the [initial configuration](/docs/handoffs/microsoft-dynamics-365/initial-configuration):

| Field             | Value                                                                             |
| ----------------- | --------------------------------------------------------------------------------- |
| **Org URL**       | The Dynamics 365 Organization URL, for example `https://yourorg.crm.dynamics.com` |
| **Tenant ID**     | The Directory (tenant) ID of your app registration                                |
| **Client ID**     | The Application (client) ID of your app registration                              |
| **Client Secret** | The client secret **Value**. The field stays hidden after you save.               |

4. Click **Save**.

![The MS Dynamics Ticketing configuration dialog with the Org URL, Tenant ID, Client ID, and Client Secret fields](/_fern-files/_img/9c438810b841b5c68504d1e72ea636c02708934d573e75c174409ec1fab61bae.webp)

## Add the Create Ticket block

The **Create Ticket** action finds or creates the Contact, then creates a Case linked to it.

**To add the Create Ticket block to your Handoff:**

1. In your handoff answer, add the **MS Dynamics Ticketing** block.
2. Under **Action**, select **Create Ticket**.
3. Fill in the inputs described in the table below.
4. Under **Save Response as Variables**, optionally save the returned values described in the outputs table below.
5. Set the block's **Fallback Answer**, so the conversation has a defined path when the Case cannot be created.

![The MS Dynamics Ticketing block with the Create Ticket action, its input fields, response variables, and Fallback Answer](/_fern-files/_img/a43cbcb1de53554e79cce55188febf5462b4cca8ca68c8dc3972775a7bfd8085.webp)

The **Create Ticket** action accepts the following inputs:

| Field                    | Description                                                                                                                                                                        |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Contact Email**        | The end user's email address. Used to match an existing Contact.                                                                                                                   |
| **Contact First Name**   | The end user's first name. Used only when a new Contact is created. Existing Contacts are never updated.                                                                           |
| **Contact Last Name**    | The end user's last name. Used only when a new Contact is created. Existing Contacts are never updated.                                                                            |
| **Contact Mobile Phone** | *(Optional)* The end user's phone number. Used to match an existing Contact only when no email address is provided.                                                                |
| **Incident Title**       | The subject of the Case.                                                                                                                                                           |
| **Description**          | The body of the Case, for example the conversation transcript.                                                                                                                     |
| **Priority**             | *(Optional)* `1` (High), `2` (Medium), or `3` (Low). Enter the digit only; a value such as `High` causes the action to fail. Leave it blank to create the Case without a priority. |
| **Custom Fields**        | *(Optional)* Additional Case fields, as comma-separated `logical_name:value` pairs. See the format rules below.                                                                    |

The action returns the following values:

| Output            | Description                                                                                                                                                                                                                  |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Incident ID**   | The ID of the created Case.                                                                                                                                                                                                  |
| **Ticket Number** | The Case number that Dynamics 365 agents and the end user both recognize. Use it to confirm the Case to the end user. It is returned only when your environment generates Case numbers automatically; otherwise it is empty. |
| **Contact ID**    | The ID of the matched or created Contact.                                                                                                                                                                                    |

If the Contact or the Case cannot be created, nothing is created in Dynamics 365 and the conversation follows the **Fallback Answer**.

### Custom field format

Use **Custom Fields** to set additional Case fields by their logical name, for example:

```txt
isescalated:true, new_attemptcount:3, new_casenotes:Customer cannot log in\, tried twice
```

Each value is converted to the field's type in Dynamics 365:

* **Text** accepts any text.
* **Yes/no** accepts only `true` or `false`, in any casing.
* **Whole number** accepts `5` or `5.0`, but not `5.7`.
* **Decimal** accepts `5` or `5.5`.

Escape a literal comma or colon in a value with `\,` or `\:`. Only the first colon in a pair separates the name from the value, so `errcode:HTTP:500` needs no escaping.

Custom fields are applied last, so a pair named `title`, `description`, or `prioritycode` replaces the value set by the corresponding input. Do not set system-managed fields such as `ticketnumber` or `statuscode`: Dynamics 365 rejects them, and the Case is then created without any custom fields.

## Test the integration

Run one test handoff to confirm the Case and Contact are created as expected.

**To test the integration:**

1. Trigger the **Create Ticket** action once from a test conversation with a test Contact.
2. In Dynamics 365, confirm that a Case was created.
3. Confirm the Case is linked to the expected Contact, rather than to a newly created duplicate.
4. Confirm the AI Agent received the **Incident ID**, **Ticket Number**, and **Contact ID**.

---

Have any questions? Contact your Ada team, or email us at [](mailto:help@ada.cx?subject=Help%20Docs%20inquiry).