Barnaby in the cloud

Advocate | Ally | Mentor | Challenger | Technologist

17 Jul 2017

Automate your life (and your calendar) with Microsoft Flow and Azure Functions

Summary: Automate the creation of new calendar items in response to specific events being added to my calendar.  Use Azure functions for custom processing to extend Microsoft Flow capabilities.

In my role as Technology Strategist I travel quite a bit and managing my calendar during that time can sometimes be a challenge.  One strategy I use is to block off a set amount of time on either side of any flights to allow for travel time to the airport and time at the airport to clear security (and customs if needed).  This process works well as it keeps people from booking calls or meetings in my calendar when I should be driving or traversing the airport.  The challenge of course is remembering to add this into my calendar when I book flights.

I’ve been spending a lot of time recently with Microsoft Flow, Azure Functions, and Logic Apps .  It dawned on me that I could use Microsoft Flow to automate the creation of my travel time and airport time whenever a new flight is added to my calendar.

Here’s the high level structure :

Microsoft Flow diagram

  1. When a new event is created in my calendar, check to see if the subject contains the word “flight”.
    • If it does not then we stop and we are finished
    • If it does we continue to the next step
  2. Figure out the times for adjacent meetings
  3. Create new calendar events based on those times (being careful not so use the word flight and create an infinite loop).

The challenge I ran into was not being able to find an easy way in Microsoft Flow to do calendar based math (for example what is the time 2 hours prior to the event that just fired off the flow).  The way to solve this is to write a little bit of code to do this for you and Azure Functions is the perfect place to do this.

comments powered by Disqus