Microsoft Flow – my first IFTTT flow

When Microsoft Flow was first announced I was not that impressed. I didn’t know exactly what I could get out of it and I didn’t really look into the product, until I saw Charles Lamanna’s talk at Integrate 2016. His talk was very inspiring and above all, it triggered me on actually using Microsoft Flow.
Charles triggered me with one simple example: his automation of reviewing job applications. Instead of having to go through each application in his inbox and send a personalized reply, he setup a flow that actually did all the work for him. By going through the applicants and simply replying “Accept” or “Reject” in Outlook, he automated the entire workflow, saving him a lot of time each morning. The flow triggers a rejection e-mail if someone is rejected, and triggers several e-mails when an applicant is accepted.
What is Microsoft Flow
Microsoft Flow enables non-developers to build simple flows for themselves and enables them to automate certain tasks, also called IFTTT-flows. It is built on top of Logic Apps and it will even be possible to actually take the Flow and “demote” it into a Logic App. It won’t surprise anyone that the experience feels very much like Logic Apps, only it’s all a little bit simpler and it;s part of your Office365 subscription, instead of Azure.
Flows are not managed, there’s no source control. Logic Apps are manageable and can go into source control, have version control etc. It’s a very easy experience, but at the same time, it may be introducing a new kind of Access.
My first attempt: Code Review notifications
We tend to get a lot of e-mails during the day, including Code Review e-mails when I need to review a colleague’s attempt to check-in some code. The task itself normally isn’t that time consuming, but you need to get to it as soon as possible of course. My problem: I tend to forget this when I am a little backed up or have a lot of meetings during the day.
To help myself with this process, I decided to design a flow that:
- Triggers when a code review e-mail is received
- Sends a notification to my Slack channel
- Adds an item to Wunderlist
- Adds a reminder to the Wunderlist task, 4 hours after the e-mail was received
The Flow
My flow definition ended up looking like this:
After receiving the e-mail, a message is posted to Slack and a Task is created in Wunderlist, but I had some trouble adding a reminder to the task. I needed to add a condition that actually checks the Id received from the “Create a task” action to the list that resulted from the “Get tasks” action.
A workaround: Enter a valid integer
The “Create a task” action returns an Id of the task that was created. You need this id to set the reminder on the task, but there is no placeholder in the Flow-designer, so I needed to use the Logic Apps definition language. It’s relatively easy to use the definition language and get the id from the response: @{actions(‘Create_a_task’)[‘outputs’][‘body’][‘id’]}. You just need to know how 😉
But if you want to add this code (either between quotes or not) in the “Set a reminder” action, it will say you’ll have to enter a valid integer, otherwise it won’t work. The flow can also not be saved.
The only way to get around this, is by getting the the entire list of tasks and adding a condition that compares the task ids. If the task ids match, the reminder will be set on that particular task. So I went along with that approach (took me a few hours before I figured this out though).
As you can see above, now there’s a placeholder called “Task ID” I could use to set the reminder. And if you want to use a date generated by a function, you should use quotes. But once you navigate away from your flow, the field is disabled. Still works though.
After running the flow, it resulted in a Wunderlist entry and I got notified in my Slack channel. That is some neat and fast integration here!
I like the idea of Microsoft Flow and it’s really easy to connect to other services. You just need to authorize apps and you are away. If you really need to get stuff done, you will still need to learn some Logic Apps definition language though. It also still has some quirks, but the product is still in preview, so no problem there.
The team will be adding more and more connectors and are also opening up to 3rd parties to submit connectors, paid or non-paid. I am expecting loads more connectors by the time Flow exits its Preview state.