Simple Visual Analytics Using Logic Apps

Logic Apps are one great way to get started if you’re not familiar with coding and looking to work your way around to automate your application processing. Logic apps have various usabilities with simple action flow creation. Today, we will be looking at Visual Analytics using Twitter and Power BI on Logic App.

PREREQUISITES

  • Azure Account. Click here to create a free trial account.
  • Power BI account. Click here to create a free trial account.
  • Twitter Account. Click here to create an account.

Step 1

Log into Azure portal and click on New > Web + Mobile > Logic App. To create a logic app.

Azure

Step 2

Name

Give a name to your app.

Subscription

Select a subscription you have.

Resource Group

Create a resource group if you don’t have any or choose an existing one if you already have one.

Location

Choose a location where you want your logic app to be hosted.

Finally, tick pin to the dashboard and click Create.

Azure

Step 3

Once the logic app has been created, it will automatically take you to the Designer blade. If not, you can select the App blade. In the designer, choose a blank app to continue.

Azure

Step 4

The logic app works on the basis of the trigger and action flow sequence. So, the first one we should be creating is a trigger.

Our trigger is going to be Twitter so search for the Twitter app and choose it. Under Twitter app, you will find trigger and action tabs. In the Trigger tab, choose when a new tweet is posted option.

Azure

Azure

Step 5

If you’re adding for the first time, you will be displayed to log into the app and authorize it. As I have already used the Twitter app, it automatically recognized me. But you would require to log in and authorize your app to use your account.

Azure

Step 6

Search text

This is where you’re going drop in your keywords you would like to search. In our case,  it’s going to be #favpet.

Interval and Frequency

This is going to let you set how much time should be taken to fire the next trigger. We are going to set it to 3 sec. So, for every 3 sec, a trigger will be activated to search if there is any tweet with the specified keyword.

Azure

Step 7

Has a trigger been created successfully, now, we are going to require an action to be executed.

At this time, you can use conditions too if you want to verify if it satisfies and only then, go to Actions. But to keep it simple, we will just go with Actions. So click on the Action and search for Power BI. Again, you will be asked to sign into your Power BI account and authorize the app to use your account.

Azure

Azure

Step 8

Once the process is complete, head to Power BI portal and go to my workspace.

At top right corner, you will find create option-click and choose streaming dataset.

Azure

Step 9

Choose API block and click Next. On next blade, enter the dataset name followed by a value. You can create as many values as you require but for now, I’m creating only one value named Content and it's going to be text format. Then, check to switch ‘on’ historic data analytics. And click Create.

Azure

Azure

Step 10

Once the dataset has been created, head back to my workspace and click on the dataset. Here, you can find all datasets that you have created. Click on the Create Report option on the dataset which you would like to use.

Azure

Step 11

Your report page is going to look something like this. On the very right side, you will have all the fields that you created as values in the dataset. Next, to it, you get various visualization tools. Choose pie chart for it.

Azure

Step 12

In this step, drag and drop the values you have created. In my case, it has just one value. You need to drop it in two places - the first one is details and the second one will be “Values”.

Azure

Step 13

To change the font size and style, switch to the paint roller icon in Visualizer tab. Here, you can do all the styling you would like to do to create a visualizing appeal to your data.

Azure

Step 14

Once the dataset has been created and the report has been generated head back to the Azure portal to finish up our logic app. Now you can see your different workspace in your logic app. choose the workspace you have created earlier. Then choose your dataset followed by the table.

Then you will be left out with values you created. We have created only one value and I get only one option. In this place, I’m just dropping in “twitter text”. You can choose whichever you want to use for analytics. Once everything is created click on save to save the workflow of the logic app. And click run to run the app. As the app starts triggering go to twitter and tweet something with the hashtag you created earlier.

Azure

Azure

Azure

Step 15

Once the logic app finds a tweet with the hashtag you can see how fast the data is processed.

Azure

Step 16

Head back to power bi portal and click refresh to see the data. Depending upon your requirement change the trigger interval and set loop option to keep the app running continuously. Make sure to keep in mind every successful trigger will cost you so plan accordingly. To test for more data run your app again and tweet with some other animal name and the pie chart will keep getting updated.

Remember we didn’t create any filters in Power Bi so if you tweet anything with the same hashtag, it will show up on the pie chart. If you want to filter the content, you need to create filters to filter only the content you need to visualize.

Azure

Azure

Step 17

As you have successfully created the report, now click on Save and give a name to the report and save it. After saving, if you wish to share it with your teammates, click on Share option that was right next to Save. Here, you can add emails or can also publish it publicly or you can integrate into any of your websites you would like.

Azure

Azure

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now