Add a Microsoft Dynamics 365 source

Microsoft Dynamics 365 is a customer relationship management typically used by support agents. A Microsoft Dynamics 365 source allows you to index any type of Dynamics entities, including support cases and KB articles. It also supports the Dynamics security scheme so that in the search results, users can only see the items they have access to in Dynamics. See Coveo, Dynamics, and Security for details.

Tip
Leading practice

The number of items that a source processes per hour (crawling speed) depends on various factors, such as network bandwidth and source configuration. See About crawling speed for information on what can impact crawling speed, as well as possible solutions.

Source key characteristics

The following table presents the main characteristics of a Microsoft Dynamics 365 source.

Features Supported Additional information

Microsoft Dynamics 365 Cloud version

9

See Microsoft Dynamics CRM / Dynamics 365 Updates.

Indexable content

All available system and custom entities, notes and files attached to records of the indexed entity types, and KB articles (body, comments, and attachments).

Content update operations

refresh

check

Takes place every hour by default. Auditing must be enabled to take account of deleted items.

rescan

check

rebuild

check

Content security options

Same users and groups as in your content system

check

Coveo, Dynamics 365, and Security

Specific users and groups

check

Everyone

check

Metadata indexing for search

Automatic mapping of metadata to fields that have the same name

This setting is disabled by default and not recommended for this source type.

Automatically indexed metadata

Examples of auto-populated default fields (no user-defined metadata required):
 

  • clickableuri

  • date

  • filetype

  • title
     

After a content update, inspect your item field values in the Content Browser.

Extracted but not indexed metadata

The Microsoft Dynamics 365 source extracts the fields you specify in your Entities to include configuration as metadata with the dy prefix.
 

After a rebuild, review the View and map metadata subpage for the list of indexed metadata, and index additional metadata.

Add a Microsoft Dynamics 365 source

Follow the instructions below to add a Microsoft Dynamics 365 source.

  1. On the Sources (platform-ca | platform-eu | platform-au) page, click Add source.

  2. In the Add a source of content panel, click the Microsoft Dynamics 365 source tile.

  3. Configure your source.

Tip
Leading practice

It’s best to create or edit your source in your sandbox organization first. Once you’ve confirmed that it indexes the desired content, you can copy your source configuration to your production organization, either with a snapshot or manually.

See About non-production organizations for more information and best practices regarding sandbox organizations.

"Sign in to Microsoft Dynamics" window

When adding a source, you must first authenticate with Microsoft Dynamics 365 in the Sign in to Microsoft Dynamics window to allow Coveo to access your content.

Note

Your source authentication may eventually fail. You’ll then need to reauthorize the source.

  1. Enter your Microsoft Dynamics 365 instance URL, and then click Sign In.

  2. Select a user that’s both a Microsoft Dynamics 365 administrator and an Application administrator, and then enter the corresponding password.

  3. Click Accept to allow Coveo to access your Dynamics 365 content.

"Configuration" tab

In the Add a Microsoft Dynamics 365 Source panel, the Configuration tab is selected by default. It contains your source’s general and authentication information, as well as other parameters.

General information

Source name

Enter a name for your source.

Tip
Leading practice

A source name can’t be modified once it’s saved, therefore be sure to use a short and descriptive name, using letters, numbers, hyphens (-), and underscores (_). Avoid spaces and other special characters.

Discovery Web App URL

Enter the Discovery Web App URL of your Microsoft Dynamics 365 instance to be used as the endpoint to connect to the web services used to communicate with the Microsoft Dynamics 365 cloud components.

If you don’t know your Discovery Web API URL, follow these steps to access this information:

  1. In the Microsoft Dynamics 365 expandable navigation panel at the top, navigate to Settings > Customization > Customizations.

  2. In the Customization page, click Developer Resources.

  3. Your Discovery Web API endpoint address appears under Connect your apps to the Dynamics 365 Discovery Service.

Organization unique name

Enter the Microsoft Dynamics 365 unique name identifying your organization. This name also appears on the Developer Resources page.

Project

Use the Project selector to associate your source with one or more Coveo projects.

"Entities to include" section

Enter a JSON configuration defining the Dynamics entities and fields to index. You can also specify conditions and relations between entities. See "Entities to Include" section reference for details on how to structure your configuration.

"Queries to include" section

Enter Microsoft Dynamics 365 FetchXML queries in execution order to index specific content. See "Queries to Include" section reference for details on how to structure your configuration.

"Content security" tab

Select who will be able to access the source items through a Coveo-powered search interface. For details on the content security options, see Content security.

"Access" tab

On the Access tab, specify whether each group (and API key, if applicable) in your Coveo organization can view or edit the current source.

For example, when creating a new source, you could decide that members of Group A can edit its configuration, while Group B can only view it.

For more information, see Custom access level.

Build the source

  1. Finish adding or editing your source:

    • When you’re done editing the source and want to make your changes effective, click Add and build source/Save and rebuild source.

    • When you want to save your source configuration changes without starting a build/rebuild, such as when you know you want to make other changes soon, click Add source/Save. On the Sources (platform-ca | platform-eu | platform-au) page, click Launch build or Start required rebuild when you’re ready to make your changes effective and index your content.

  2. On the Sources (platform-ca | platform-eu | platform-au) page, follow the progress of your source addition or modification.

  3. Once the source is built or rebuilt, review its content in the Content Browser.

Index metadata

To use metadata values in search interface facets or result templates, the metadata must be mapped to fields. Coveo automatically maps only a subset of the metadata it extracts. You must map any additional metadata to fields manually.

Note

Not clear on the purpose of indexing metadata? Watch this video.

  1. On the Sources (platform-ca | platform-eu | platform-au) page, click your source, and then click More > View and map metadata in the Action bar.

  2. Review the default metadata that your source is extracting from your content.

  3. Map any currently not indexed metadata that you want to use in facets or result templates to fields. The source extracts the fields you specify in your Entities to include JSON configuration as metadata with the dy prefix.

    1. Click the metadata and then, at the top right, click Add to Index.

    2. In the Apply a mapping on all item types of a source panel, select the field you want to map the metadata to, or add a new field if none of the existing fields are appropriate.

      Note

      For advanced mapping configurations, like applying a mapping to a specific item type, see Manage mappings.

    3. Click Apply mapping.

  4. Return to the Sources (platform-ca | platform-eu | platform-au) page.

  5. To reindex your source with your new mappings, click your source, and then click More > Rebuild in the Action bar.

  6. Once the source is rebuilt, review your item field values. They should now include the values of the metadata you selected to index.

    1. On the Sources (platform-ca | platform-eu | platform-au) page, click your source, and then click More > Open in Content Browser in the Action bar.

    2. Select the card of the item for which you want to inspect properties, and then click Properties in the Action bar.

    3. In the panel that appears, select the Fields tab.

"Entities to include" section reference

Your JSON configuration should be formatted as follows. Each object in this configuration represents a type of Microsoft Dynamics 365 entity to index.

[
...
  {
    "name": "entityTypeName",
    "conditions": [
      {
        "field": "fieldName",
        "operator": "Equal",
        "type": "STRING",
        "values": [
          "name"
        ]
      }
    ],
    "fields": [
      {
        "name": "fieldName"
      }
    ],
    "relations": [
      {
        "name": "linkedEntityTypeName",
        "fields": [
          "fieldName"
        ],
        "fromField": "sourceObjectField",
        "toField": "targetObjectField",
        "toObject": "linkedObjectName"
      }
    ]
  },
...
]

name (string, required)

The type of the Microsoft Dynamics 365 entity to index.

Example: account

conditions (array of object)

Each object in this array represents a condition that an entity must meet to be indexed.

Example:

"conditions": [
  {
    "field": "address1_country",
    "operator": "Equal",
    "type": "STRING",
    "values": [
      "canada",
      "mexico"
    ]
  },
  {
    "field": "address1_addresstypecode",
    "operator": "Null",
    "type": "UNARY"
  },
  {
    "field": "address2_latitude",
    "operator": "GreaterThan",
    "type": "NUMBER",
    "values": [
      "42"
    ]
  }
]

field (string)

The Microsoft Dynamics 365 field on which the condition is based.

operator (string)

The condition operator.

Available operator options are: Equal, NotEqual, GreaterThan, GreaterEqual (is greater than or equal to), LessThan, LessEqual (is less than or equal to), Contains, DoesNotContain, BeginsWith, DoesNotBeginWith, EndsWith, DoesNotEndWith, Like (is like), NotLike (isn’t like), In (is included in), NotIn (isn’t included in), Null (doesn’t contain data), and NotNull (contains data).

type (string)

The type of data specified under values.

Available types are: STRING, NUMBER, and UNARY.

UNARY indicates that no values are expected for this condition (for example, with the Null operator).

values (array of string)

The field values to put in relation with the operator.

fields (array of object, required)

Each object in this array is the name of a metadata field to index for the desired entity. Specify at least one field.

Example:

"fields": [
  { "name": "accountid" },
  { "name": "name" }
]

relations (array of object)

Each object in this array represents a Microsoft Dynamics 365 entity related to the indexed entity.

Example:

"relations": [
  {
    "name": "customeraccount",
    "fields": [
      "name",
      "modifiedon",
      "websiteurl"
    ],
    "fromField": "customerid",
    "toField": "accountid",
    "toObject": "account"
  }
]

name (string)

A string identifying the type of related entity. This doesn’t need to match the Microsoft Dynamics 365 entity name, as it’s only for identification purposes.

Example: customeraccount

fields (array of string)

The names of the metadata fields to retrieve from the related entity.

Example:

"fields": [
  "name",
  "modifiedon",
  "websiteurl"
]

fromField (string)

In the entity to retrieve, the foreign key identifying the related entity from which you want to index some metadata.

Example: customerid

toField (string)

The primary key identifying the related entity from which you want to index some metadata.

Example: accountid

toObject (string)

The type of entity to retrieve, as displayed in Microsoft Dynamics 365.

Example: account

"Queries to include" section reference

Your FetchXML configuration should be formatted as follows. You can enter more than one query. If you do, queries will be executed in the order they appear in the configuration.

<queries>
  <query>
    <id>active-cases</id>
    <name>Active Cases</name>
    <queryXml>
    <fetch>
      <entity name="incident"></entity>
    </fetch>
    </queryXml>
  </query>
</queries>

id

A unique string identifying your query.

name

A name identifying your query for troubleshooting purposes.

queryXml

The FetchXML query to execute to retrieve the desired content.

Reauthorize the source

To authenticate and access your content, your source uses OAuth 2.0, a protocol that grants access to external applications without exposing the user’s real credentials. OAuth 2.0 has access tokens that need to be updated manually when expired.

  1. On the Sources (platform-ca | platform-eu | platform-au) page, click your source, and then click More > Update access token in the Action bar.

  2. In the Update access token confirmation dialog:

    1. If this option is available, check the Also update the token in the source identity security provider configuration box.

      Note

      Before you update the access token used by the source identity security provider, ensure that no source configurations will become invalid.

    2. Click Update.

  3. On the page that appears, log in with the email address and password of the account that you created for the source to index your content.

Required privileges

You can assign privileges to allow access to specific tools in the Coveo Administration Console. The following table indicates the privileges required to view or edit elements of the Sources (platform-ca | platform-eu | platform-au) page and associated panels. See Manage privileges and Privilege reference for more information.

Note

The Edit all privilege isn’t required to create sources. When granting privileges for the Sources domain, you can grant a group or API key the View all or Custom access level, instead of Edit all, and then select the Can Create checkbox to allow users to create sources. See Can Create ability dependence for more information.

Actions Service Domain Required access level

View sources, view source update schedules, and subscribe to source notifications

Content

Fields

View

Sources

Organization

Organization

Edit sources, edit source update schedules, and edit source mappings

Organization

Organization

View

Content

Fields

Edit

Sources

View and map metadata

Content

Source metadata

View

Fields

Organization

Organization

Content

Sources

Edit

What’s next?