@mentions in Slack From Microsoft Power Automate

In my last post, I demonstrated how to create a basic workflow that posts to Slack when email is received that matches specified criteria. Pretty cool, right? Sometimes you want to make sure that somebody gets a notification about these important messages that you’re posting, though. Slack has a built-in way to do this with its mentioning system.

Unfortunately, mentioning a user or group from Power Automate isn’t as straightforward as you might expect. When you specify message text like @somegroup it just shows up in Slack as that text.

The reason it doesn’t work is because the text isn’t parsed to use special formatting required by Slack for things like mentioning. The good news is that the workflow widget will do this work for you if you enable Parse Mode=full in the advanced options.

The bummer about using Parse Mode=full is that you can’t include other object entities e.g. an email object’s subject. Enabling full parsing gives us a great hint at the solution if we look at the run results…

So if we know the “special formatting” values, we can use those in messages? Yep!

It’s not a perfect solution because there doesn’t seem to be a good, built-in way to retrieve the special formatting for a Slack user or group required to @mention them from Power Automate, but it does give you a couple ways to accomplish the goal of mentioning them in messages you post. You can enable full parsing in advanced options to mention from a static text message, or determine the special formatting for a user or group yourself to use in a dynamic message constructed from other entities in your workflow!


Author: Adam Prescott

I'm enthusiastic and passionate about creating intuitive, great-looking software. I strive to find the simplest solutions to complex problems, and I embrace agile principles and test-driven development.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: