Teams Real Simple with Pictures: Flows triggered with Keywords; Commands through the front end

This blog is part of a series on Teams. For more articles, check back often

Written: 12/04/2022 | Updated: N/A

Hands up! There was a time when I was dead against automation. Early in my IT career I was a provisioner and back then all the setups and the migrations were done manually. Can you believe there was a time when we used to move mailboxes by Exmerge and via SFTP servers? That’s right, 5 hops of live data. Or when we used to login manually into DNS servers to manually add DNS records to zones? A record by A record CNAME by CNAME. Yeah I remember it. But why was I dead against automating that? Because I am human. I thought that automation wasn’t having faith in people. I thought it would ultimately lead to us all being done out of the job. So here I am. 14 years in. It never gets any less busier. It is, by all accounts, the myth of Sisyphus. But I get automation now. I got it when I went through a period a few years back where I was so busy that I practically couldn’t cope anymore with the volume so needed to learn Power Automate to save minutes, minutes which turned into hours. Now? I use it extensively. I’ve blogged previously on some of the ways that I use it in my job. How I use it with Lists, and Forms, and Approvals. I use it with Dynamics. So I was excited to see, having been away a while, that Power Automate released a trigger for Teams which uses keywords.

Why?

Because if we think of the ways keyboard shortcuts, or slash commands work, we can now go on to create our own set of commands for automation flows based on simply spinning up a private channel (and we don’t even need that because keywords can be used in any channel or group chat). Let me show you. I have been playing around with this the last couple of days and it’s already yielded some good results.

Let’s go.

This blog will cover

  • Spinning up a private channel
  • Spinning up a flow using the keyword trigger
  • Spinning up a command list
  • More examples
  • Conclusion

Prerequisites

  • Teams and Power Automated Licence (Within Microsoft 365 Licence)
  • Teams Owner Permissions (if creating the channel)

SPINNING UP A PRIVATE CHANNEL

I decided to use a private channel because the Power Automate trigger is explicitly when a keyword is mentioned so I want a place where I can use them to launch flows which isn’t going to be used by others

1.) I have deployed a fresh team called Keyword Test. On that team I select More Options (…) and then select Add Channel

2.) I add a title of Commands and then set privacy to Private and select create

3.) I select Skip. I won’t be adding members to this private channel

4.) My private channel is created. Good.

SPINNING UP A FLOW USING A KEYWORD TRIGGER

Now the private channel is set up and ready for me to launch commands, I need to set up a flow linked to a particular keyword which will launch it.

1.) Login to Power Automate and select Create from the left navigation

2.) Select Automated Cloud Flow

3.) Add a Title for the flow. In this example I will use Meeting Protocol Reminder. This is a completely fictional example off the top of my head – that when I mention a keyword it will send out an email to my team members to remind them of meeting protocols for an upcoming meeting. Chose the trigger When Keywords are mentioned and select Create

4.) The trigger is now in place. Set the following

Message Type: Channel or Group Chat (this example uses Channel)
Keywords: The keyword which triggers the flow (this example uses ‘MeetingProtocols’)
Team: The Team the Channel is in (this example uses the Team set up – Keyword Test)
Channel: The Channel the keyword can be used in (this example uses the private channel – Commands)

Once done, select New Step

5.) This is where your example may diverge and this becomes purely fiction. The fictional example is that I want an email to go to my team with the protocols for meetings before an upcoming meeting. In this fictional scenario we hold these meetings regularly and instead of writing out an email every time I simply want to add a keyword to the teams channel and it emails. To complete the flow, in the New Step I would search for and select Send an Email (V2) which is an Exchange Action

6.) I add the members of my team which will be emailed, the title of the email and the content outlining the protocols for the meeting. That’s all I need. It’s an incredibly simple flow. Once done I select Save on the top right.

7.) I can also use the flow checker to ensure there isn’t any issues

8.) All good? Let’s test this out. In the team I go to the Command channel start a new conversation and then enter my keyword which is MeetingProtocols and then enter

9.) Let’s see if it worked. By all accounts the flow ran.

10.) But I want to ensure the email got there. I open up Mar’s mailbox and there it is

Now imagine I did that for every upcoming meeting. How much time that would save me from having to write out an email, find my team in the address book, send the email, probably get distracted in doing so. Imagine doing this for several different processes and how much time it could save.

I could even pin the command channel to the top of the teams app. Easy to get to whenever I need.

SPINNING UP A COMMAND LIST

Ok, so if we were going to create a set of automation flows based on a set of keywords – or commands, then – being human – we would probably need to remember them because the more we use the easier it would be to forget. It doesn’t have to be difficult – we could use the private channel itself and build out a list, Take the below screenshot which shows the command (keyword), name of the flow, a description of what it does and the proceeding action.

This is a simple view but you could build a more complex list

MORE EXAMPLES

So I have used the fictional example of sending an ad-hoc email to the team to remind them about meeting protocols for an important upcoming meeting. Another example could be asking team members to update a PowerPoint asset in preparation for the monthly meeting by triggering a post into the general channel of the team. A hyperlink goes through to the PowerPoint which opens in the browser

Here’s another one if you wanted to purge a list of old entries and start afresh

CONCLUSION

Basically in my role I do a ton of repetitive things. I wanted to cut down on repetition which didn’t add value to my role and which was anchoring down my time. Later, I realized that whilst I like PowerShell this still has it’s overheads in terms of scripting. Flows off the back of singular keywords – which could be considered commands which can be triggered ad-hoc makes a lot of sense because it can save a ton of time whilst being mega simple. But being as transparent as possible there a load of challenges. Trying to remember the keywords sound easy right – and is easy – except it isn’t because it could get more complex or you don’t use them regularly enough to stick, or the flow is too narrow to fit the nuance of the situation, or you build too many which aren’t programmatic enough. Yet implementing a few of these has already saved me time. Anything which can do that is welcome. Now there are a thousand more people more qualified and more talented in the Microsoft Community when it comes to automation. I think this could go on to be something good. I look forward to seeing if people look at it further.