Click here to Skip to main content
15,850,547 members
Articles / Hosted Services / Azure

MebhiChokiDAR – Tweet Sentiment Analysis and More Using Microsoft Flow

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
22 Mar 2019CPOL4 min read 4.8K   1   2
How to do sentiment analysis using few clicks and see live graphical representation using Power BI live feed

Microsoft Flow provides various templates to achieve your goal and Twitter Sentiment analysis is one of them.

In this tutorial, we will see how to do sentiment analysis using few clicks and see live graphical representation using Power BI live feed.

As in India currently, #Mebhichokidar hash tag is very viral. So,we are using this hashtag to cross check how it is going.


There are 3 basic prerequisites to complete this task:

  1. You should have Microsoft flow account. If you don’t have that, then you can create via link
  2. You should have Microsoft Power BI account. If you don’t have, then you can create via link
  3. You should have Microsoft Azure Portal account for cognitive services. If you don’t have, then don’t worry, you can create via link

Once you have all the 3 accounts available, then proceed step by step as suggested below.

Step 1

Just open the Microsoft flow and select the template “Run Sentiment Analysis on tweets and push Result to a Power BI dataset” as shown in the below figure:


Step 2

When you select the option, you will find the below screen as shown below:


Step 3

We have to configure 3 connections as expected, text analytics connection (Azure cognitive service), Power BI (live dashboard) connection and last but not the least, Twitter connection.

Here, as I am using an Office 365 common account, so my power BI already authenticated using that.


Step 4

Now, let me connect with My twitter account first. Which can be done by clicking Sign In. In this, you need to authorize the flow to access your twitter account.


Step 5

In the next step, you have to define text analysis connection for which you have to first login into Azure and search for cognitive service. If it does not exist, then create by clicking Add button.


When you click add button, you will find the below link as you can see. Search Text Analytics and select the option highlighted as below:


Provide proper Resource Name and select pricing tier as per your convenience. I am choosing free tier for this example.


Step 6

Once you create the account, you need to copy the Key from Get your Keys option and copy the Web API option from 2b as shown below:


Step 7

So far so good, we have created cognitive service and now moving back to Microsoft Flow and configure the Text analytics. Give any name in connection name and provide Account key which we copied earlier and also copy the Web API.


Step 8

Now, we are done with the connection. The next step is to configure the steps. So, when a new tweet is posted, we will provide that tweet to our Cognitive service using detect sentiment which will provide sentiment score. The sentiment score will be given to Power BI.


Step 9

Now, click on twitter option here, you can add multiple text option. For example, you can see in the below search text that we have added NarendraModi, Chokidar or MaybheeChokidar.


Step 11

Now, delete Detect Sentiment action and add again by searching the sentiment:


Step 12

Here, we will configure the sentiment option as you can see. We are giving Tweet Text and Language (we are selecting English Language).



Step 13

Now, in the next step, we will configure the Power BI for which we will login and click on Streaming Dataset option because we are going to provide.


Step 14

Now, click on API as shown in the below image:


Step 15

Now, define the dataset as shown. Below here, we are defining the fields. So, in the fields, we are adding SentimentScore (which will be given by cognitive service), TwitterDate (when tweet posted), username (who posted the tweet), tweetText (what is the tweet).


Once you define the dataset, click on Create.

Step 16

Now, save the Report and configure the report as per your requirements.


Step 17

Here now configure, Power BI dashboard and remove the payload as shown in the below figure:


Step 18

See the below configuration which configured:


Here if you see, we defined workplace which we have created and dataset defined just above and mapped the fields.


Step 19

Now, save the flow and configuration and try to run it. If everything works perfectly, you will get all the checkboxes.


Step 20

Now, you can see the Power BI dashboard. You will get the graph updating per minute with the new tweet text whenever there is a post with a specific tag.

Below, you can find sentiment score graph.


In the next post, I will share the details of this sentiment analysis data.

Hope you might like this easy way of sentiment analysis.

Happy learning!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Team Leader
India India
I am Rajat Jaiswal from India. I am working as a Technology specialist in one of the reputed company in India with 12+ years of experience. I am a Microsoft Data Platform MVP & Alibaba Cloud MVP.
I have always had an affinity to learn something new in technology. Database, Web development, Cloud computing are the areas of my interests always.
I have been a regular contributor to technologies with more than 300+ tips. Learning & Sharing is one of my aims always. Writing blogs, delivering sessions, helping on forums is my hobby.

Comments and Discussions

QuestionNice article Pin
Manoj Kumar Choubey12-Dec-21 20:06
professionalManoj Kumar Choubey12-Dec-21 20:06 
Nice article
Manoj kumar choubey
Sr. Software Developer

AnswerRe: Nice article Pin
Rajat-Indiandotnet6-Feb-22 19:06
Rajat-Indiandotnet6-Feb-22 19:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.