Automated Running Late Notice With Flow and Flic Button

A couple weeks ago, I was surfing through Twitter and saw a post about a Microsoft Flow Smart Button.  I was bummed when I found out I couldn't get an official Microsoft Flow Button so I decided to order the Flic Smart Bluetooth button instead.  The Flick button allows you to connect to almost any IOT device to perform a variety of tasks.  You can turn on your smart lights, skip to the next song on Spotify...and the list goes on. 

I started reading about some killer use cases for the Flick button from clocking in and out of work to tracking attendance at events. My head started spinning with ideas on how I could use this smart button within Office 365 using Flow.  There are already several Flow templates for the Flick button as you can see in the screenshot below.  I plan on using the event tracking in a SharePoint list Flow for my user group meetings!

Figure 1 - Flow Templates for Flic

As I started thinking about use cases beyond the templates, I thought about a recent struggle I had. I had a day jam-packed with meetings.  One of my meetings ran over and I was driving frantically to the other meeting across town when I hit some unexpected traffic.  An intense wave of panic came over me when I realized that my normally punctual self was going to be at least 5 - 10 minutes late for my next meeting.   Wouldn't it have been great if I was able to simply press my little green Flic button and it automatically notify the meeting attendees that I was going to be a few minutes late?

The Flic Button - It's about the size of a Quarter

Let's Make it Happen!

Before we start building the Flow we need to make sure our Flic button is set up.  The important thing to know about the Flic button is it has to be tied to your cell phone.  You have to download the Flic App on your IOS or Android device, create an account and run through the wizard to add your Flic button.  Once you have that configured, you have to tell it that you want to use Microsoft Flow for the action (Click, Double Click, or Hold).  Just click the Plus (+) button next to the action you want to trigger on and scroll down to the "Advanced" section on the next screen and select "Microsoft Flow".

Ok, now that the Flic button is set up we can move on to building our Flow.  First thing we need to do is create a Blank Flow and search for Flic in the Triggers.  We will use the "when a Flic is pressed" Trigger.

Find the Flic Trigger

If this is your first time using the Flic connector you will need to login to your Flic account to complete the set up.  In the settings you'll select the Flic button you want to tie this to and the event is should be tied to (single click, double click, hold, etc).  
Flic Trigger Configuration

Now that our Trigger is configured, we need to find the next upcoming event on your calendar and get the event information.  To do that, we'll use the "Get Calendar View of Events" Office 365 Outlook Action.  This Action allows us to return events from our calendar within a given date range.

It's safe to assume that since you'll only be triggering this Flow if you are running late that we can filter the events between the moment you press the button and within an hour of that.  Select your calendar from the Calendar Id dropdown list.  For Start Time we will add an Expression with UTCNow() to get the current date/time at button press.  For End Time we will add an expression to get the current date/time plus 1 hour. 

That expression will look like this:
Get Calendar View of Events End Time Configuration

If we expand the properties of the Get Calendar View of Events Action, we have several more settings we can configure.  We will want to Order By Start asc and use a Top Count of 1.  This will ensure we get the most recent event and only return that event.

Get Calendar View of Events Settings

Now that we have the information for the meeting we are running late to, all that's left is to add a "Send Email" action so we can notify the attendees.  The "To" field will be the attendees property from our Get Events Action.  The Subject will use the "Subject" field from our Get Events Action and we will add "Running Late".  Then we will fill out the body with a sincere apology and will let them know you'll be there soon.  

Email Set Up

And we're done... just save and test it out!   This is one Flow that I hope I never have to use but it sure will come in handy if I do!