> For the complete documentation index, see [llms.txt](https://developers.didomi.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.didomi.io/integrations/third-party-apps/microsoft-dynamics-365/microsoft-dynamics-365-current.md).

# Microsoft Dynamics 365 (Current)

{% hint style="success" %}
**Available for:** Preference Management Platform (PMP)

**Premium Feature:** Microsoft Dynamic 365
{% endhint %}

Didomi allows you to update your Microsoft Dynamics Contact Point Consent attributes with the preferences collected through your Preference Management Platform (PMP).

## Implementation

### **Connection**

Didomi connects to Microsoft Dynamics Dataverse on your behalf through the following parameters:

* Client ID
* Client secret
* Server instance
* Azure tenant ID

### **Options**

**Upsert mode**

You can choose allowing Didomi to create contact in Microsoft Dynamics 365, by setting `upsert_mode` to true. Otherwise, when a consent is collected but the `organization_user_id` value does not match with any contact in Microsoft Dynamics 365, the consent update will not be propagated.

### **Mapping**

Didomi updates the Contact Point Consent table/entity in Microsoft's Dataverse with your organization's end-user preference selections. Mapping directs the integration on how to set the different end-user responses within the Contact Point Consent table/entity.&#x20;

Review the table below for more information on how purposes and preference values map to your Microsoft Dynamics 365 (Current) configuration.

<table data-header-hidden><thead><tr><th width="138.79998779296875"></th><th></th></tr></thead><tbody><tr><td>Purpose</td><td><p>Purposes configured in your organization's Didomi account will target <br>the Purpose (<code>msdynmkt_purpose</code>) column of the Contact Point Consent table. </p><p></p><p>Mapping options for purposes will include any configured attributes for the column by <code>msdynmkt_purposeId</code>.</p></td></tr><tr><td>Preference values</td><td><p>Preference values configured in your organization's Didomi account will target the Topic (<code>msdynmkt_topic</code>) column of the Contact Point Consent table. </p><p></p><p>Mapping options for preference values will include any configured attributes for the column by <code>msdynmkt_topicId</code>.</p></td></tr></tbody></table>

## Configuration

<table><thead><tr><th>Property</th><th width="419.800048828125">Description</th><th>Required</th></tr></thead><tbody><tr><td>Client ID</td><td>A client ID of the created Azure Enterprise application</td><td>Yes</td></tr><tr><td>Client secret</td><td>A client ID of the created Azure Enterprise application</td><td>Yes</td></tr><tr><td>Azure tenant ID</td><td>Tenant ID of your Azure app settings</td><td>Yes</td></tr><tr><td>Server Instance</td><td>Your REST API endpoint</td><td>Yes</td></tr><tr><td>Upsert mode</td><td>By setting upsert_mode to true you allow Didomi to create contacts in Microsoft Dynamics</td><td>No, Default value = false</td></tr><tr><td>Mappings</td><td>Mapping for properties between Didomi and Microsoft Dynamics Dataverse</td><td>Yes</td></tr></tbody></table>

{% code overflow="wrap" %}

```javascript
{
    "type_id": "microsoft-dynamics-cpc",
    "authentication": {
        "client_id": "your_client_id",
        "client_secret": "your_client_secret",
        "tenant_id": "your_azure_app_tenant_ID",
        "instance": "your_rest_api_endpoint"
    },
    "properties": {},
    "mappings": [
        {
            "id": "purpose:<msdynmkt_purposeId>" or "topic:<msdynmkt_topicId>",
            "value": "<pmp_preference_value_widget_id>"
        }
    ],
    "upsert_mode": true
}
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers.didomi.io/integrations/third-party-apps/microsoft-dynamics-365/microsoft-dynamics-365-current.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
