According to Wikipedia, emotion recognition is the process of identifying human emotion, most typically from facial expressions as well as from verbal expressions. Automatic analysis of emotions from verbal expressions uses techniques from Machine Learning (a subset of Artificial Intelligence).
In my previous post, I showed you how to successfully implement the Emotion Analysis without writing a single line of Apex. There are options for integrating Emotion Analysis with your Salesforce instance that we explored so that you can perform an analysis of emotions based on the verbal expressions that customers make every day with your organisation.
Letโs revisit the Use Case once more.
As a Support Representative, I need to analyze the emotion of the text in the Description field of a Case record created via Email to Case or Web to Case. Depending on the emotion, I want to automatically present to the Support Rep., Recommendations or the Next Best Actions that need to be executed.
In order to โshow Recommendations or the Next Best Actionโ that the Support Representative can perform based on the analyzed emotion, we will use Einstein Next Best Action (aka NBA).
If you havenโt explored NBA, I would highly recommend you to take a glimpse at this ~30 mins long Trailhead Module.
Creating Flows & Recommendations for Various Emotions
Now, to keep things simple, we will create two Recommendations โ
- What should the Support Rep. do when the Customer is Happy
- What should the Support Rep. do when the Customer is Sad
Even though we have 5 different emotions that will be analyzed by Indico, we will map โ Anger, Fear and Sadness to โSadโ and Joy and Surprise to โHappyโ (look at the Formula in figure 10).
This means that we will be creating 2 Recommendation records in Salesforce โ Sad & Happy. But even before creating the Recommendations, you need to create two Active Flows.
Confused? Letโs revisit it. Now, how does Einstein Next Best Action work in Salesforce? The Next Best Action basically displays the Recommendation records (that we are yet to create) based on filters. On the Recommendation record, you need to specify โ โHow should the Recommendation be executed?โ For example, if the customer is happy, prompt the Support Rep. to send an email. If the customer is sad/unhappy, prompt the Support Rep. to activate the warranty. So the Recommendation here is nothing but the prompt with the message i.e., โPlease Send a Thank You Emailโ or โActivate Warrantyโ while the execution of the Recommendation is achieved through Flows.
So in essence, you would use a Flow to execute the Recommendation i.e., the process of sending the email or activating the warranty.
Like as I already mentioned, to keep things smooth, we will create 2 Flows that would check 2 checkboxes on the Case Record:
Note: In both the Flows shown above (Activated), ensure that you have a variable of type Text named as recordId created to store the Case Id as shown in figure 16.
Fig. 16
The next thing that you need to do is to create Recommendation records in Salesforce. So in order to do the same, click on the App Launcher and click on the Recommendations tab.
Create two Recommendation records as shown below:
Fig. 17
Fig. 18
Note: You can add Custom Fields to the Recommendation object just like any other object in Salesforce. In our use case, I have added a Custom Text Field called Category and filled it with the values Happy and Sad for the respective Recommendation records. This will allow me to query the Recommendation records easily while building the Strategies (in the next section).
Building the Strategies using the Next Best Action Strategy Builder
Now, we need to create 2 different Strategies that would query and show the Recommendations on the Case record based on the detected emotions.
In order to create Strategies, start typing โNext Bestโ in the Setup and then click on New Strategy.
Happy Customer Strategy
1. Drag a Load Element on to the canvas.
2. Specify the Conditions as shown in figure SB 1.1.
3. Save the strategy.
Sad Customer Strategy
1. Drag a Load Element on to the canvas.
2. Specify the Conditions as shown in figure SB 2.1.
3. Save the strategy.
Adding Einstein Next Best Action to the Record Page
Now, edit the Case Record Page and add 2 Einstein Next Best Action components and configure them like as shown below โ
Summary: Lights, Camera, Action!
Voila! Letโs give it a whirl.
This blog has taught you how to โshow Recommendations or the Next Best Actionโ to your support users using Einstein Next Best Action, integrated with emotion analysis.
Iโve also proved that you can accomplish complex implementations these days without actually writing Apex anymore, thanks to the amazing point-and-click features available today.

Leave a Reply Cancel reply
Comments: