Use Power Automate to Auto Post Status Message on Your Teams Profile

Scarlett Li
3 min readApr 27, 2023

--

The COVID-19 pandemic has become a part of history, and many people have returned to their offices for their daily work duties. However, the pandemic has inevitably changed many aspects of our past working arrangements. Many public and private sectors have adopted a hybrid working arrangement, allowing and supporting employees to work both at home and in the office. Employers no longer assign a specific office or workstation for employees, and instead use a room booking system, allowing employees to book a spot when they go into the office.

In this hybrid working environment, the real challenge is trying to figure out where our colleagues are and where they’re sitting. Of course, we could just send them a Teams message or email, but that’s too easy. Instead, there is a subtle way to get that information – we can update our Teams status to let them know that we’re in the office today and where to find us. It’s like playing a game of hide and seek!

Obviously, if anyone has to manually post such a status message on Teams, they might forget or feel a bit lazy to do so. After all, we already have tons of work waiting for us when we start our day in front of the computer, who needs extra work like that, not to mention it’s so trivial.

But fear not, my fellow office warriors! There’s a quick and easy solution to this problem. We can create a Power Automate flow that will automatically post our whereabouts on Teams. The logic is straightforward: the flow will check your calendar of the day every workday morning at 9 am and if it finds an event with the subject “WFO” (Work From Office), it will post a status message on your Teams profile saying “WFO today @ {office#}.” Simple, right?

One thing you need to make sure is to name your event subject “WFO” when you book your office spot for the day. Or better yet, you can build a flow that automatically books a spot with subject “WFO.” But that is a story for another day. Now that you have your booking settled, the flow shown below will take care of the rest.

The Power Automate Flow Which Posts a Teams Status Message for You about Your WFO & Location

The output looks like this:

Teams Status Message

A few key points:

I have set the flow to check my calendar with Start Time as following: (Note that I convert the time to Eastern Standard Time which is my time zone.)

startOfDay(convertFromUtc(utcNow(), 'Eastern Standard Time'))

End Time:

convertFromUtc(addHours(utcNow(),10), 'Eastern Standard Time')

Also, this part could be tricky — the site address of Teams. When you copy and paste the link from below (or type in as what I have in the screenshot), you might likely get an error message in the flow. IGNORE IT. It works. For some reason, Microsoft seems to want you to think that it doesn’t. Just proceed to complete the flow, save, and test it. You will see it runs smoothly. (And once you run it successfully, the error message will no longer show up.)

https://presence.teams.microsoft.com

That’s it! My flow runs religiously every day. So each time I am in the office, people can hover over my profile and see that I am in and where I sit. Let me know if you run into any errors. (💡 Make sure you double check the JSON codes to have “ ” wrapped around the output status message in the last step, this seems to be one of the common errors people encounter.)

Happy automating!

--

--

Scarlett Li

I am an ‘Extroverted’ Introvert who finds Data Science fascinating, arts captivating and sports exhilarating.