Pages Menu
TwitterRssFacebook

Posted by on Oct 25, 2017 in Development, Microsoft Teams

Building an Out of Office reminder with the new Microsoft Teams Connector for Microsoft Flow

Building an Out of Office reminder with the new Microsoft Teams Connector for Microsoft Flow

A few days ago I blogged about how to build an Out of Office reminder system using Skype for Business. At a pre-defined time every day, if your Automatic Replies were turned on then Microsoft Flow would automatically send your direct manager a Skype for Business instance message to remind them you wouldn’t be in.

Another new Connector which recently made it into Preview is the Microsoft Teams Connector, which lets you list channels, list teams, create a channel, and post a message to a channel:

We can take the same Flow that we had before and make some modifications so that instead of emailing a manager, it drops a short note into a Teams channel – letting the whole team know that you’ll be offline for the day.

The first steps are the same – we still want to run on a daily schedule and check Automatic Replies on our Office 365 account:

However, if this condition is true, then we want to do something different.

It would be cool to take the text of the Automatic Reply, since that usually contains useful information about return-to-work dates, and copy it into Teams. In my previous post I mentioned that Automatic Replies are stored in HTML, so wouldn’t render well when copied to Skype for Business (we used a HTML>Text Converter last time). Happily, Microsoft Teams renders HTML just fine so we don’t need that, leaving the code looking more simple:

Notice that I have to choose which channel I want my message to go into. You potentially could loop through all channels in all teams and post to each one of them…but I wouldn’t recommend it!  For a low-importance informational message like this it’s best to pick a general-purpose channel just to keep people reminded. I’ve also kept it simple and not included any images of palm trees and cocktails, but feel free to go all-out in making your co-workers envious 🙂

The automatic reply message that gets picked up by the Mail Tips connector is the internal out of office message, not the external one.

Here’s what that looks like it Teams:

There you have it. It’s a simple but effective way to cut down on the amount of email you’ll get whilst you’re away, simply because people didn’t notice you had your Out of Office set. Now there’s no excuse because they’ll see that information right in their Teams client.

Written by Tom Morgan

Tom is a Microsoft Teams Platform developer and Microsoft MVP who has been blogging for over a decade. Find out more.
Buy the book: Building and Developing Apps & Bots for Microsoft Teams. Now available to purchase online with free updates.

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.