Emails have feelings too!

Visit Website View Our Posts

Emails have feelings and so do cases, web form submissions, survey responses, and any other text based field in your Dynamics 365 (CRM) system!


You receive communications from your customers on a daily basis from a variety of sources, such as email, web submission forms, support cases, etc. Imagine if you could have instant visibility to how your customers are FEELING based on the text they send you without reading it. Angry customers can be addressed immediately via a phone call from a real person. Happy customers can be sent an automatic email and receive a personal follow up within a day or two.


What do you need to do this? D365, a subscription to Azure, and these instructions. Missing any of these? Don't worry, we can help!


There are 3 simple elements to setting up a cognitive service in Azure to gauge sentiment on your D365 records:

  • Add a custom field to the entity in D365
  • Setup a Cognitive Service in Azure (one-time setup)
  • Create a Logic App in Azure to make the magic happen


Using the backend machine learning engineering written for Cortana's Intelligence, you can setup a simple logic app in Azure to scan text from your CRM records and return a score of 0.00 - 1.00 based on your customer's sentiment. That's right, you can find out how your customers FEEL based on the text they send you.


"What do I do?"

First, decide which entity you would like to detect sentiment: Email Messages? Cases? Leads? A custom entity?

In D365, create and add a new field to a form (for example, your Email form) called Sentiment Score.


You can come back later to add the field to views and create a rollup field on a related entity for higher-level analysis.


Next, you need to create the service in Azure. This is a one-time setup. You will be able to reuse this service for multiple apps.

In Azure, create a new Text Analytics API service called 'CognitiveService-TextAnalytics'. Be sure to select the appropriate Pricing tier* based on your usage. You can change this in the future, if necessary.


In order to set up the Logic App in the next steps, you will need the exact Name and the Access Key for this service. From your start page in Azure, navigate to the service you just created and click on it to view it and click on 'Show access keys…' to copy the key.


Side note: this is where you will be able to see all of the analytics for the service once records start flowing through your logic app.


Finally, you will create the Logic App to connect D365 and Azure.

In Azure, create a new Logic App under Web + Mobile and give your app a name that includes the entity name in it as well, such as SenitmentAnalysisEmail. Once the app deployment is complete, access your app to begin the design.


In the Designer window, select the 'Blank Logic App' from the Templates area. You will be adding 3 steps to your app - 1 trigger step and 2 action steps.


Step 1: Trigger: Dynamics 365 - When a record is created

Connect to your D365 org using login credentials for a system admin account with a password that does not expire and select the appropriate entity from the list. Set the desired Frequency and Interval (for a constant check, select Seconds and enter 1).


Step 2: Action: Text Analytics - Detect Sentiment

Key in the exact Name of the service you created and paste the key that you copied. Click in the Text field to select the text field from the entity that you would like to analyze, such as Description.


Step 3: Action: Dynamics 365 - Update a record

Connect to your D365 org and select the appropriate entity. Click in the Record Identifier field to select the field that represents the unique id of the entity record, such as Email Message for the email entity.


Click on the link to 'Show advanced options' - this shows all of the fields on the selected entity that you can update. Find the field that you created in D365 in Step 1 and select the Score field from the right.


Click Save in the command bar to save the Logic App.


That's it! Now you can test it by creating a new record in D365.


Don't forget that you can view the analytics in Azure by going to the Service and/or to the Logic App. This will help you keep a watch on how many calls (record updates) occur during a given time and will allow you to view errors, if any occur, on the updates.


"There were so many steps! What does my Logic App actually do?"

You logic app is triggered when a new email (or your selected entity) record is created in your D365 organization. Once the new record is created, using the machine intelligence from the Detect Sentiment service, the Description field will be analyzed and the assigned score from 0.00 to 1.00 will be sent back to your D365 system and written to the custom field that you created.


Good news! You've created the Azure Service, which you only have to do once. Going forward you can use the same service on as many apps as you would like. You can also add Conditions to your Logic App that can branch off for multiple scenarios. You can even write additional code to parse out your text to return an even better sentiment score.


"Now what?"

This is only the beginning! Now that you have this score, the next steps for your organization are endless. Use this field to trigger workflows to send a variety of email responses or update other fields. Add score based icons to your views. Perform analysis and rollup on a customer, contact, product, campaign, (and so on) basis. The bottom-line is that you will be providing the BEST customer service that you can offer by being able to immediately gauge your customer's sentiment.


Beringer Technology Group, a leading Microsoft Gold Certified Partner specializing in Microsoft Dynamics 365 and CRM for Distribution. We also provide expert Managed IT Services, Backup and Disaster Recovery, Cloud Based Computing and Unified Communication Systems.


*Pricing tiers are as follows. Be advised that a "call" is a single record updated in D365.

F0 (5k Calls per 30 days) (may or may not be available)

S1 (100K Calls per 30 days)

S2 (500K Calls per 30 days)

S3 (2.5M Calls per 30 days)

S4 (10M Calls per 30 days)

Show Buttons
Hide Buttons