In Dynamics 365, we often record customer feedback in the system . The content can be of both positive or negative.
Feedback can be recorded in numerous places such as using the feedback entity or as an Activity. As a customer record grows in the CRM system there will be multiple activity or feedback records created which can make it hard to identify the positives from the negatives. This will also make it hard for the Customer Service Representative to identify if the customer is a happy customer or an unhappy customer , so that proactive measures can be taken to win back the customer. So, what if there is a way to easily identify the positive and negative feedback and determine if the customer is a happy, sad or neutral .
I was recently going through the list of Cognitive services offered by Azure and stumbled upon an interesting service called the Text Analytics Service.
What the service does is that, if I pass a bunch of text to the Analytics Service it will provide me with the sentiment score. The higher the sentiment score it is a positive sentiment (positive feedback) or lower the sentiment it is a negative sentiment (negative feedback). You can try a demo of this service via this URL
Now, how can we connect this service to Dynamics 365 so that it can look at the text in an Activity or a Feedback record and provide a sentiment? There are two answers.
- You can write a plugin that passes the text to the analytics API every time a record gets created in CRM.
- If you are already using Azure Logic App Service or Flow, there is a connector where you can pass the CRM data to the Text Analytics API.
Today in this article we are going to look at the 2nd option where we can pass the CRM data to the analytics API via Logic App Service (I will use Logic App Service for this example as Flow is very much the same ).
Note: This article only demonstrates the capability of passing the CRM data to the analytics API via flow or LogicApps. This not a full business solution.
Determine Customer satisfaction using Subject field content in the D365 Phone Call Activity entity. The customer satisfaction should be displayed in a visual format i.e. Smiley Face in the Activity record.
Below are the tasks we need to achieve for the solution to work
- Created a LogicApps Service in Azure.
- Generate a Cognitive Services API key.
- Configure LogicApps Steps to connect the Cognitive Services.
Step 1 : Created a LogicApps Service in Azure.
- Navigate to the Azure Portal
- Search and Add the Logic App service.
Step 2: Create a Cognitive Services API key
- Navigate to the following URL and generate an API Key for the Text Analytics API
- Generated API key
Step 3: Configure LogicApps Steps to connect the Cognitive Services.
Configuring LogicApps Steps consists of 3 items
- Select a Trigger (e.g. when a record is created in D365)
- Passing Text from the Triggering entity to the Sentiment Analysis Engine
- Updating the Source Record with the Sentiment Score
- Navigate to LogicApps in Azure and create a blank logicapp.
- Select the Trigger as when a record created in Dynamics 365. At this point you will be prompt to provide the login details to the D365 instance.
- Select the Org Name of the D365 instance and select the type of record for which the trigger should occur. In my example I am selecting Phone Calls
- Once the D365 Instance and the Trigger stage is complete , create an Action and select “Text Analytics – Detect Sentiment ”
- Specify entity field that should be used for the sentiment detection. I am using the text on the Subject field on the Phone call entity.
- Once the Sentiment Step is complete we need to update the Source record from D365 with the Sentiment Score returned from the Text Analytics engine. For this I have created a custom field called “Analytics Score”.First, I have to provide a Record Identifier to retrieve the source record that needs to be updated.Next I have to provide the custom field we created before to store the Text analytics score.