Where twitter meets SQL
I am Barath Balasubramanian, the extensibility program manager in the Microsoft Flow team. If you would like to explore integration opportunities with Microsoft Flow, ranging from providing a simple #HREF link to flow.microsoft.com from your application to being able to use the full CRUD/manage operations on Flows via REST APIs from within your application, I am your man. This blog post is for an advanced user scenario of connecting to a SQL server by creating a flow from scratch. Make sure you read the getting started blog here first.
Today, I am going to walk you through creating a Flow that will capture tweets, every time a specific #hashtag is tweeted, we then add an entry into a SQL server table with that tweet information. This is a powerful scenario when compared to posting a message on Slack or Yammer when a tweet arrives because having this data in SQL lets you mine the data at a later time for market sentiment about the #hashtag you care about most.
Here are the simple steps to get this going
1. Go to https://flow.microsoft.com and select My flows
2. Select create new flow button
3. Add a trigger for when a new tweet appears
4. Sign in to Twitter
5. Add a #hashtag string e.g. #Azure. Create a connection to Twitter
6. Add an action for Insert row into a SQL Server. Learn how to quickly get started with SQL Azure databases here.
7. Setup the SQL connection with a connection string like this – "Server=contoso.database.net;Database=db_name;User Id=db_user;Password=db_pass;"
8. Select the table you setup on the SQL server and link values from the tweet to the appropriate column on the SQL table
9. Give a name to the Flow and click Create Flow
10. Once saved, you will enter the testing experience. The UI waits until the trigger event happens. Tweet with the #Azure hashtag or wait for a tweet to happen, when it happens, you will see the run result right away.
That’s it! It is real! You have really created a complex task of inserting a new record into a SQL table, every time someone tweets a #hashtag. Neither did you have to write complex web service code against Twitter developer APIs, nor did you have to create a complex connection to a SQL server with an intermediate API layer between your client and the SQL server. Since I created the Flow for this blog post, I converted it into a template, so can quickly get started with this template. With Microsoft flow, business users can really change the way things are done at a workplace.
- Check out this document on how to extend Microsoft Flows for your scenarios.
- Share your scenarios with us on how you would like to use Microsoft Flow.
- Contact us to embed Microsoft Flow from right within your applications.