Save Only A Positive Tweet To Excel Spreadsheet Using Microsoft Cognitive Service In Azure Logic App

Introduction

This article helps you to learn how to save only a positive tweet about a specific hashtag to an Excel spreadsheet using Microsoft Cognitive Services in Azure Logic App.

Azure Logic Apps

Logic App is a cloud-based service. It allows us to react to an event in one service (such as -SharePoint online) and do something with the data from that event into another Service (such as Twitter). It makes it practical and simple for business processes. The users build workflows that automatically perform some business tasks and processes across applications and services. We can connect our business-critical apps and services with Azure Logic Apps, automating our workflows without writing a single line of code.

Before reading this article, please go through some important article links, mentioned below.

Here, we will see how to save specific Twitter tweets to Excel Online automatically.

Twitter

Twitter is an online news and social networking service where users post and interact with messages. Posts or "tweets" here are restricted to 280 characters. Registered users can post tweets, but those who are unregistered can only read them. Login here for using Twitter.

Excel

Microsoft Excel is a spreadsheet for Windows, macOS, Android, and iOS, developed by Microsoft. It features calculation, graphing tools, pivot tables, and a macro programming language called Visual Basic for applications.

How to create a Logic Flow for saving a specific Tweet to Excel spreadsheet

Here, we need to connect to Twitter, Microsoft Cognitive Service (detects Sentiment), and Excel Spreadsheet.

Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Prerequisites

  • Microsoft Azure Account.
  • Twitter Account.
  • OneDrive-Excel Online.

Follow the below steps to build a Work Flow using a template.

Step 1

Login to https://portal.azure.com/

  • In the dashboard, select "Create a resource" and click on "AI + Machine Learning". Now, choose Text Analytics for creating the Cognitive Service.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Enter the name you want to assign to the Text Analytics, choose the subscription and resource group where you organize related resources, and location where your logic app stored and the pricing tier. Then, click on "Create".

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Under the Keys, you have keys for accessing the Text Analytics.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Step 2

Now, let us create the Logic App for detecting the positive tweet and store it on the Excel Spreadsheet.

  • In the dashboard, choose to create a resource and click on Integration. Now, choose Logic App.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Enter the name you want to assign to the logic, choose the subscription, resource group where you organize related resources, and location where your logic app is stored. Then, click on "Create".

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Here is the dashboard. Click on Logic App Designer.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Step 3

Now, click on the Blank Logic App.

Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Step 4

Configure the data by signing into Twitter and Excel Online.

  • Search Twitter on the search bar.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Choose the Triggers.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Next, we sign in.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • We give permission to access our accounts.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Next, set the Specific Keyword ( Eg. Holiday) which you want to store that specific tweet to Excel Sheet. And then, give the time interval and frequency for checking the workflow as one minute.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Step 5

Configure the Text Analytics for detecting the sentiment of the tweet.

  • Search for Text Analytics.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

  • Choose the Action.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

  • After that, check the condition.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

  • Configure the condition.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Step 6

  • Next, we want to save that positive tweet into the Excel sheet, so search for Excel Online.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Then, choose the Action for the workflow.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Next, we sign in to OneDrive.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • We give permission to access our accounts.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Next, Choose File Name and Table Name for saving the tweet.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • Then, Choose the Fields what you want.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App
  • The Final Workflow will be like this.

    Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Step 6

Now we save and run the workflow and run it.

Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Output

Send a positive Tweet

Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Now the Tweet should be saved in Excel.

Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Logic App Evaluation

Save Only a Positive Tweet to Excel Spreadsheet using Microsoft Cognitive Service in Azure Logic App

Summary

I hope you understood how to save only a positive Tweet about a specific hashtag to the Excel spreadsheet automatically and how to run it. Stay tuned for more.