Dev Notes

Notes on Development with Microsoft Technologies

Microsoft Flow : Building a Simple Twitter to Trello Flow

Leave a comment

In this post, I hope to give you some ideas of how easy it is to use Microsoft Flow as I walk through how I created a really simple flow. The flow looks at my Twitter timeline and captures Tweets that contain a specific keyword. When it finds tweets that match, a card is created on my Trello board so I can review it later. This scenario could easily be expanded for an organization that wants to monitor a product launch or needs to field support requests from customers or clients and have them tracked by a team in Trello.

Before we begin, let me introduce you to Microsoft Flow. It is a new service currently in preview that allows you to “Create automated workflows between your favorite apps and services to get notifications, synchronize files, collect data, and more.” If you have used web sites like IFTTT or Zapier, you may be familiar with the general idea of Microsoft Flow. These tools allow you to build workflows between various internet based applications.

For example, I have an IFTTT recipe that automatically puts my cell phone on silent any time I reach my office building and another IFTTT recipe that notifies me if my Nest thermostat detects my house has reached 80 degrees (uh oh, time to call the A/C repairman). The focus of these tools is to make it easy for a user to automate a small task.

I’ve already mentioned a few tasks that I commonly have another internet automation tool complete for me, so what is different about Microsoft Flow? Yes, in a lot of ways it looks to be yet another internet automation entry into a flooded space of alternatives. The key difference for this service, in my opinion, it that it is focused on automation in the enterprise. This means it taps into the power of Azure and O365. Using gateways, it also has the potential to connect to on-premise enterprise systems extending the reach of flows beyond those currently on the market. This makes it quite clear it is not just another entry into the space.


From the homepage of flow, there is an option to see my flows (You must be logged in with a Work or School account to see this option, sign-up is free!).

f1

This takes me to the screen to create a new blank flow or select a flow from an existing template. There are a large number of templates that you can use to start building flows. If you have not previously connected to a service represented in the template, you will be required to create the connection before you can continue.

Creating a blank flow loads the designer and prompts for the trigger. After typing Twitter in the trigger box, the results are filtered making it easy to find the specific trigger needed.

f2

As I mentioned previously, if the service has not yet been connected a request will be presented to create the new connection.

f3

Simply sign into the service and then authorize Flow to be able to use it. This is a standard OAuth authorization request currently used across the web.

In my scenario, the service should be watching for Tweets containing Microsoft Flow. A basic understanding of how the service utilizes search lets me know the phrase will need to be contained within quotation marks. If the desire is to monitor for specific users or hashtags, the search team would be the users’ twitter name (i.e. @cquick) or the desired hashtag (#Rio2016).

f4

This completes the configuration for the Flow Trigger. Unfortunately, there is no ability to currently test the flow to see what is returned. I hope that feature is added at some point because I can see scenarios where you might have triggers coming from a custom API (HTTP + SWAGGER) or Azure Service Bus and you need to make sure you are getting the correct data without running the flow first.

The next step in creating this simple flow is to add an action to take after the trigger is successfully run. Click on New Step and a couple of options are presented. (I have clicked on More so those options are visible as well).

f5

By far, the most common action will either be adding some type of condition or going straight to some type of action. This shows there is an ability to iterate over multiple items that a single trigger could return.

In this simple flow, creating an action to Trello is the desired path. Clicking on Add an action presents the action window. It looks identical to the trigger so the same steps can be taken to locate the desired action. In this case, typing Trello provides the option for creating a new card.

f6

Again, if the service has not yet been connected it will need to be connected and authorized before it can be used by Flow.

In this step, I encountered one of the bugs in the system. I could easily select a Trello board, but selecting the specific list failed. Remember, this is still a preview so there will be the occasional hiccup.

f7

It is actually pretty easy to solve since Trello offers the ability to export a board as JSON data. I just need to export the data and look for the id of the list to use. Since that is outside the scope of the article, I’m not going to focus on each of the steps to accomplish the goal. I am mentioning it because I want to explain why the configuration of the flow shows a globally unique identifier instead of the friendly name of the Trello list.

Configuring the action is actually pretty easy (aside from the note above). The trigger passes data to the action. It is easy to identify the source when clicking on a text area. Flow attempts to give you quick access to the most commonly used properties from the trigger. In the screenshot, the action is configured to utilize the Flow Tweets board and a list has been specified. The title of each card will contain A new tweet by and then the name of the user. The description for the Trello card will be the content of the Tweet.

f8

This completes the steps for my flow. Now the flow needs a name. This is done by clicking at the top of the flow on Untitled followed by typing the name of the flow.

f9

Clicking Create Flow will create the flow and start monitoring for the trigger to be fired. You can review the status of all of your flows by clicking on the Activity tab at the top of the flow page. It looks like I maxed out my calls to the Twitter API. I guess I need to add a delay activity to my flow so that doesn’t happen again!

f10


This was an example of a very simple flow. It demonstrates how easy it is to create a flow and get it working. I started by specifying a trigger, I added an action to take based on that trigger and then I saved the flow. At that point, it began creating cards on my Trello board (https://trello.com/b/Z66SUFfm).

In my opinion, this promises to be a great tool allowing business users to automate some of their day-to-day activities. It is pretty evident even in this preview, there are some really powerful templates being created:

f11

Advertisements

Author: Chris Quick

I have been a developer of web based solutions since early 2001 delivering solutions to a wide array of organizations using ASP, ASP.NET and SharePoint. I was introduced to SharePoint in 2003 when the consulting firm I worked for at the time introduced it into the workplace. I began working with MOSS 2007 as soon as Microsoft released the RTM version in November 2006. The platform was implemented at the organization I worked for in 2007 and went live in March of that year. I was tasked with the administration and ongoing development of the platform. I currently work as a SharePoint Architect with Artis Consulting, developing solutions for a wide variety of business problems. The goal of this blog is to share my discoveries developing solutions with SharePoint. I welcome your comments and feedback to any post -- and I welcome suggestions for future topics.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s