The public preview of Microsoft Flow and PowerApps was announced at the end of April. I was lucky enough to be able to attend Integrate 2016 at the ExCel London where Charles Lamanna ran a session about this new offering.
Microsoft Flow is a SaaS tool enabling the user to automate workflow between applications and SaaS services, and not just those developed by Microsoft. On the extensive and expanding list of available connectors are Dropbox, Slack, Facebook and Instagram, as well as the expected Microsoft services such as Office 365, Sharepoint Online, OneDrive etc.
After listening to Charles’ presentation, and with a nod to Jeff Hollan who, during his Logic Apps talk, showed an integration very similar to the one I am about to demonstrate, I quickly put together a simple Flow to send all tweets that were posted to Twitter with the hashtag #integrate2016 to a specific channel on our company Slack team site.
To start, you will need to go to the Microsoft Flow site and sign-up if you have not already done so.
Microsoft provides a bunch of templates to get you started, there is even one for posting to Slack if a new tweet matches with a hashtag:
However, for the purposes of demonstration I am going to create one from scratch.
From the top menu bar select “My flows” and then “Create new flow”.
You should now be presented with a “How would you like to start?” box with a list of available actions. Enter “twitter” and then select the available action.
If this is the first time you have attempted to connect to Twitter from Microsoft Flow, you will be prompted to authenticate.
Enter your credentials and you will be returned back to the flow. You can now enter the hashtag you want to filter on.
Next I added a condition to filter out retweets. Click the + beneath the Twitter action and choose “Add a condition”.
You will be given some basic options that you can use to build a condition, but this is not sufficient for what we need, so instead click “Edit in advanced mode”.
Enter the condition as the following. This examines the content of the “TweetText” that has been returned from the Twitter action and compares the first two characters with “RT”.
The final step is to add an Action under the “If yes” branch of the Condition to post to Slack. Again, if this is the first time you have connected to Slack you will need to authenticate.
Once the connection has been created, configure the Action to post to the correct channel within your Slack Team, and the content that you want to push.
Your completed flow should now look like this:
And now we can start to see corresponding Tweets appearing in our Slack channel.
As an aside, you can view the Connectors that you have configured by clicking the person icon in the top right corner of the page and selecting “My connections”.