> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nekt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Dynamics 365 CRM as a data source

> Bring data from Microsoft Dynamics 365 CRM (Dataverse) to Nekt.

Microsoft Dynamics 365 CRM (Customer Engagement — Sales, Customer Service, Field Service) stores its data in Microsoft Dataverse. This connector reads that data through the Dataverse Web API (OData v4), so it works across the standard CRM entities as well as any custom entities and fields configured in your environment.

## Before you start

Dynamics 365 authenticates server-to-server with OAuth2 client credentials, but Dataverse also requires the application to be granted access **inside your environment**. Your Dynamics 365 environment administrator needs to complete these steps once:

<Steps>
  <Step title="Register an application in Microsoft Entra ID">
    In the Azure portal, register a new application and create a **client secret**. Note the **Directory (tenant) ID**, the **Application (client) ID**, and the secret value.
  </Step>

  <Step title="Add the app as an Application User in Dataverse">
    In the Power Platform admin center, open your environment and go to **Settings → Users + permissions → Application users → New app user**. Add the registered application and assign it a **security role** that grants read access to the tables you want to sync.
  </Step>

  <Step title="Copy your organization URL">
    In Power Apps, open **Settings → Developer resources** and copy the **Web API endpoint** host, e.g. `https://myorg.crm2.dynamics.com`.
  </Step>
</Steps>

<Warning>Without the Application User and security role (step 2), the connector receives an authorization error even with valid credentials. Only your environment administrator can grant this access.</Warning>

## Configuring Dynamics 365 CRM as a source

In the [Sources](https://app.nekt.ai/sources) tab, click the "Add source" button on the top right, then select Dynamics 365 CRM from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

Provide the credentials gathered above:

* **Organization URL**: Your Dataverse organization (Web API) URL, without a trailing path — for example `https://myorg.crm2.dynamics.com`. The region segment varies by data center (`crm` for North America, `crm2` for South America, `crm4` for Europe, and so on).
* **Tenant ID**: The Microsoft Entra ID (Azure AD) directory (tenant) ID.
* **Client ID**: The Application (client) ID of the Entra app registration.
* **Client Secret**: The client secret of the Entra app registration.
* **Entities**: The list of Dataverse entity **logical names** to sync (for example `account`, `contact`, `lead`, `opportunity`). Each entity becomes a stream. Leave it empty to use the standard CRM entities, or add your own — including custom entities.
* **Start Date**: (Optional) The earliest `modifiedon` timestamp to sync for incremental streams.

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync. Each stream corresponds to one of the configured entities. For faster extractions, select only the streams relevant to your analysis.

> Tip: The stream can be found more easily by typing its name.

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired Layer where the data will be placed, a Folder to organize it, a name for each table, and the type of sync.

* **Layer**: choose between the existing Layers on your catalog. This is where your extracted tables appear once the extraction runs successfully.
* **Folder**: a Folder can be created inside the selected Layer to group all tables created from this source.
* **Table name**: a name is suggested, but you can customize it. You can also add a **prefix** to all tables at once.
* **Sync Type**: choose between INCREMENTAL and FULL\_TABLE.
  * Incremental: each extraction fetches only records changed since the last run, based on the `modifiedon` column.
  * Full table: each extraction fetches the current state of the entity.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers), consider how often you want data to be extracted from this source.

Optionally, you can define additional settings such as Delta Log Retention and an additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync) to complement the incremental extractions.

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking the arrow button. Once executed, your data appears in your Catalog.

<Warning>For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.</Warning>

# Streams and Fields

Streams are discovered dynamically from your environment. For each entity you configure, the connector reads its Dataverse attribute metadata and builds the table schema from it — so the columns always match your organization's actual configuration, including custom fields.

The standard entities synced by default are:

<AccordionGroup>
  <Accordion title="Accounts">
    Companies and organizations you do business with. Primary key `accountid`; incremental on `modifiedon`.
  </Accordion>

  <Accordion title="Contacts">
    People associated with accounts. Primary key `contactid`; incremental on `modifiedon`.
  </Accordion>

  <Accordion title="Leads">
    Prospects and unqualified sales opportunities. Primary key `leadid`; incremental on `modifiedon`.
  </Accordion>

  <Accordion title="Opportunities">
    Qualified, potential revenue-generating deals. Primary key `opportunityid`; incremental on `modifiedon`.
  </Accordion>
</AccordionGroup>

You can sync any other Dataverse entity — such as `incident` (cases), `task`, `activitypointer`, `systemuser`, or your own custom entities — by adding its logical name to the **Entities** setting.

## How columns are represented

Because the schema is derived from Dataverse metadata, a few column conventions are worth noting:

* **Lookup and owner columns** appear as the related record's GUID under the key `_<name>_value` (for example, the account's primary contact is `_primarycontactid_value`).
* **Choice / option set columns** (such as `statecode` and `statuscode`) are returned as their integer option code.
* **Currency columns** include a companion `<name>_base` column holding the value converted to the organization's base currency.

<Note>Incremental sync captures new and updated records via the `modifiedon` column. Deletes are not captured.</Note>
