Looking for PowerObjects? Don’t worry, you’re in the right place! We’ve been part of HCL for several years, and we’ve now taken the final step in our acquisition journey: moving our website to the HCL domain. Nothing else is changing – we are still fanatically focused on Microsoft Business Applications!

PowerObjects Blog 

for Microsoft Business Applications

|

Microsoft Dynamics 365 Contacts to Customer Insights

Post Author: Yuji Mikami |

In today’s post, we will discuss ingesting Dynamics 365 Contacts in Customer Insights. We focus on Audience Insights with Individual Consumers, as well as an architecture for ingesting data. The steps are as follows:

  • Architecture of Ingesting Data
  • How to Ingest Data to Customer Insights
  • Unifying Dataverse Contacts in Customer Insights
  • Viewing Dynamics 365 opportunities in Customer Insights

Architecture of Ingesting Data

Dynamics 365 data is in Dataverse. Power Query is used to ingest data from external data sources to Customer Insights. This means that there are several ways to ingest data. We use Azure Data Lake Gen2 as data source connector to ingest Dynamics 365 data to Customer Insights. We consider processed data before ingesting data to Customer Insights for optimized and for better refresh performances.

Power Platform has a feature to export data from Dataverse to Azure Data Lake gen2 in Azure Synapse Link. In this process, we can choose tables/entities in Dataverse to export ADL gen2 in csv files. Data from Dataverse is automatically refreshed every hour. We can also use the ADL gen2 data to develop Power BI reports in Workspaces in Azure Synapse if required.

Architecture

Data flow in red arrow for this blog example:

Graphical user interface, application

Description automatically generated

How to Ingest Data to Customer Insights

Let’s start ingesting Dynamics 365 data from Dataverse to Customer Insights! We use a Dynamics 365 free trial environment and a free trial Customer Insights environment. The user is an administrator with Global admin role assigned. We export sample contacts in Contact table and use the columns including Contact Id, Full Name, First Name, Last Name, Email, Phone, Gender, Address Street 1, City, Postal Code, State and Country.

Step 1: Create an Azure Synapse Link in Dataverse

We create a storage account with Azure Data Lake Gen2 where location is the same as the Dynamics 365 tenant lives. We can check the location in a process of creating the Azure Synapse Link after clicking the “New link to data lake” button.

Important: the storage account must have a role assigned before creating the link from Dataverse to the Azure Data Lake gen2. We assign “Storage Blob Data Contributor” to the global admin user who created the storage account.

In this example, East US is the location where the storage account must be created in.

Graphical user interface, text, application

Description automatically generated

Please note that we have an option to select “Connect to your Azure Synapse Analytics workspace” to link to an Azure Data Lake in Synapse workspace. However, in this case, we export data from Dataverse to the Azure Data Lake Gen2 created in the image below.

We select entities/tables in Dataverse. We are going to export contacts as customers, and opportunities as activity data for Customer Insights. We have an advanced setting where we can select partitions monthly or yearly. In this case, we use a small set of opportunity records, and the records are less frequently refreshed so that select yearly. If using incremental and frequent refresh, then it is recommended selecting monthly partitions.

Graphical user interface, text, application, email

Description automatically generated

Graphical user interface, application

Description automatically generated

Once clicking “Save” button, a file system is created.

Graphical user interface, text, application, chat or text message, email

Description automatically generated

We can also see in the Azure Storage Account where two containers are created.

Graphical user interface, application

Description automatically generated

“dataverse-xxxxx” container includes data from Dataverse.

Table

Description automatically generated

Resources:

Step 2: Configure a Customer Insights Service Principal to ADL gen2

In this step, we are going to configure a Permission that the Customer Insights application can access to the storage account where the Contact and Opportunity records are exported.

We register Customer Insights as an application. Let’s go to Azure Active Directory and Enterprise Applications. Let’s search for “Dynamics 365 AI for Customer Insights” after changing to “All Applications” in the Application type.

Graphical user interface, text, application, email

Description automatically generated

We are going to assign “Storage Blob Data Contributor” role to the application (Service Principal) in the storage account so that the Customer Insights application can access the contact and opportunity records in the Azure Data Lake gen2.

Graphical user interface

Description automatically generated

Resource:

Step 3: Use Azure Data Lake Gen2 Connector in Power Query

We are going to ingest records from Azure Data Lake Gen2 to Customer Insights via Power Query. The “Azure data lake storage” option in Customer Insight worked when ingesting data; however, we experienced errors when we match contact records with other contact records in different data sources and also experienced timeout error when refreshing data.

Let’s go to “Data source” in Data in Customer Insights. Click on “+ Add data source” button and select “Microsoft Power Query” We give it a name as “Dataverse.” Click “Next” button.

Graphical user interface, text, application

Description automatically generated

In this example, we select “Azure Data Lake Storage Gen2.”

Graphical user interface, application

Description automatically generated

We get the file system endpoint URL in the storage account in Azure Poral and paste it to the “URL” textbox and select “CDM folder view.” Click Next after sign in with your organization account.

Graphical user interface, application

Description automatically generated

We select entities, “contact” and “opportunity” in cdm folder and click “Transform data.”

Graphical user interface, application

Description automatically generated

We select columns in Contact and Opportunity entities. It is helpful to have an advanced search view open in Dynamics 365 for a contact and an opportunity view to reference field name (not display name) when selecting fields/columns in Power Query. Advance fined views show the schema name of the fields that match in the column list in Power Query.

A screenshot of a computer

Description automatically generated with medium confidence

We check the data type. We also create option set values with Conditional Column feature in Power Query. For example, the gender in contact records in Azure Data Lake gen2 is only numbers but no text label.

Graphical user interface, table, Excel

Description automatically generated

Data is ingested in the “Data sources” in Customer Insights.

Graphical user interface, application

Description automatically generated

Unifying Dataverse Contact Data in Customer Insights

We have other contacts from eCommerce systems ingested to Customer Insights. We are going to unify these contacts in Dynamics 365 and the contacts in the eCommerce system. There are same contacts in Dynamics 365 contacts in the eCommerce system.

First, we add Contacts in Dataverse to Map area in Unification process. We map the field data type to Customer Insights defined data type.

Graphical user interface, application, Teams

Description automatically generated

Graphical user interface, application

Description automatically generated

Once mapping is complete, we create a matching rule between contact entity in CRM (primary) and contact entity in Dataverse. We set the same matching rule with fullname fields. We could also add email addresses for matching rule to make it more accurate.

Graphical user interface, text, application, email

Description automatically generated

Once matching is complete, we combine some common fields such as first and last names in the contact tables in different data sources. Then we merge the contact records from all the three contacts entities. We create customer profile records in Customer Insights.

We run only Merge in this step.

Graphical user interface, text, application, Word

Description automatically generated

In this example, 5,030 customers are created in Customer Insights profile.

A screenshot of a computer

Description automatically generated with medium confidence

Viewing Dynamics 365 Opportunities in Customer Insights

We configure activities in Customer Insights. These activities are associated to the contacts from different data sources. One is online purchase activity in eCommerce system; another is in-store purchase activity in loyalty program system; and the other is opportunity in Dataverse in Dynamics 365.

Graphical user interface, application

Description automatically generated

Let’s create an activity for opportunity. Wizard walks us through to complete the configuration.

Graphical user interface, text, application

Description automatically generated

A picture containing graphical user interface

Description automatically generated

Graphical user interface, application

Description automatically generated

Graphical user interface, application

Description automatically generated

After reviewing, click on “Save activity” button. We run the activities to associate the customer profile and run “Run Merge and downstream process” in Merge in Unify.

We can create a few measures and segments. In this example, we create actual and estimated opportunities sales measures.

Graphical user interface, text, application, email

Description automatically generated

Here is an example of a customer profile from Dynamics 365 and other systems. We can see an opportunity with open status and sales measures for actuals and estimates sales!

Graphical user interface, application, email

Description automatically generated

Happy Customer Insights-ing!

Joe CRM
By Joe D365
Joe D365 is a Microsoft Dynamics 365 superhero who runs on pure Dynamics adrenaline. As the face of PowerObjects, Joe D365’s mission is to reveal innovative ways to use Dynamics 365 and bring the application to more businesses and organizations around the world.

Leave a Reply

Your email address will not be published. Required fields are marked *

PowerObjects Recommends