Intermediate | Flow of the Week: Early Meeting Reminder

Hi Flow Community!

Have you ever missed an important meeting because it was before your normal work hours? This happened to me one too many times, so I decided to do something about it! My flow runs every night around 8 p.m. and sends me and email if I have a meeting before 10 a.m. the next day. This gives me time to change my alarm if needed or make other plans. 10 a.m. may not be “early” to a lot of you, but these values are easy to change.

Before I get into the implementation, if you only care about the solution, I’ve created templates for Office 365 Outlook, Outlook.com, and Google Calendar/Gmail. I’ll be walking through the Office 365 Outlook version, but the others are pretty much the same.

In theory this a straightforward flow, given the handy “Get calendar view of events” action. Get current time, add hours, get events, send an email. But of course time zones have to show up and complicate things. So let’s break it down.

Here’s the math-y part. “Get current time” uses UTC, so we have to convert it to local time to work properly with the startOfDay() function. It turns out that even though we specify the “Round-trip [o]” format, it loses the time zone information here, so we have to convert it back to UTC to be useful to the calendar action. We then add a day to get start of day tomorrow, then another 10 (or however many) hours to get the threshold for “early”. These actions are also all available as functions if you’d like to condense this part, but the actions make for a more readable and fillable template.

NOTE: I didn’t specify the minutes in my Recurrence trigger, meaning it will run sometime between 8:00 and 9:00. If you specify exactly 8:00 you can skip the time zone stuff and do +4h, +10h to get the range. This makes for a brittle template though because changing one value requires changing the others, and we have no real need to run exactly on the hour.

This is the easy part. We pass the calculated times to “Get calendar view of events action”. For Outlook, we pass the “isAllDay eq false” filter because all-day events don’t count as early. Google Calendar doesn’t have an equivalent filter, so instead we use the “Filter array” action and check whether the start time has a “T” separator in it, indicating a specific start time vs. an all-day event.

We then check if there are any events in the array. Normal condition stuff.

From here we could send an email that says “Early meeting! Go check your calendar!” and call it quits. But where’s the fun in that? Instead, let’s convert the events to local time and put them in a more readable format for the email. You can skip the “Apply to each” in favor of a “Select” action here, but that doesn’t let us leave the time zone blank for the template.

Finally, we send the reminder email. Outlook.com and Gmail require you to type in your own email address, but Office 365 has a handy “Get my profile” action that saves you the trouble.

That’s it! Hopefully this flow helps keep your schedule running smoothly. Extra credit if you can get it to filter out an 11:00 a.m. Monday through 5:00 p.m. Friday event (not “all-day” but multi-day), or to remind attendees of the early meeting you scheduled. Let me know in the comments if you have any feedback or if you have any cool timing or scheduling flows of your own.