Sentiment & Phrase analysis using Cognitive Services via MSFlow

In this digital transformation era implementing AI and Cognitive services into any of our service and application where ever possible plays one of crucial role improving end-user/customer/business decision and overall experience.

Let's us see a scenario for Ratsub Tech (A Fictional company) is B2B & B2C e-commerce retailer who is interested to understand "UserVoice" e-Mail by tracking its mailbox to understand user experience/sentiment towards their purchases.

Create a form to capture User recent purchase and provide a placeholder to fill their thoughts or you can also use adaptive forms will see about this later. At this point assume there is an interface for end-user to fill and send back there 'UserVoice'. Setup an e-Mail rule and move these emails(i.e. To:uservoice@ratsubtech.com) to "Support" folder.

//Sample e-mail template for this usecase
From: rathanavel@live.in
To: uservoice@ratsubtech.com
Subject: CustomerID^639~ProductNo^HY-U509~Product^Sport-100 Helmet, Black~sub^Awesome product
Body: This is cool product and i loved it...


Here starts the MSFlow Part. Add Outlook webhook - Trigger to "Support" folder


Get email


Assign values to variables
  • Customer ID
  • SkuID (Product ID)
split(split(body('Get_email')['Subject'],'~')[0],'^')[1]


split(split(body('Get_email')['Subject'],'~')[1],'^')[1]




Now, Extract three parameter that Text Analysis services offerx
  1. Language detection
  2. Key phrases
  3. Sentiment analysis
Check this article to configure Text Analysis API in Azure Language Detection

Key Phrases

Sentiment analysis


Create variables in MSFlow


Setting up new variable for later use


Check condition and configure values

I have created a Stored Procedure to lookup and insert Product & Customer anonymous information to "TA_Uservoice" table.
I don't have data for UserAge, UserGender, UserLanguage in my 'Adventure Works DB'. So i am passing NULL value by default.

Execute Stored Procedure from MSFlow



Select your stored procedure


The connector would automatically request parameters values

Configure them with respective variables



We have analysed and inserted data so far will see how to use these for business decisions and use this functionality for more use-cases. let me know your thoughts in comments will try work out those use-cases too with the given data.

So, stay tuned!

-Ratsub

Comments

Popular posts from this blog

Secure When a HTTP request is received Power Automate a.k.a MS Flow

People picker Control in PowerApps

Upload attachment to SharePoint list item using Microsoft Flow

Modern page provisioning using page template

Approval and auto escalation with time out in Microsoft Flow

Developing custom reusable components in PowerApps

Headless-Daemon calling AAD secured API

Step-By-Step Azure AD App Registration

HTML field & Date Time formatting in powerapps

REST call returns XML instead of JSON in SharePoint