cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JPey
Regular Visitor

When Keyword Phrases Are Mentioned In A Teams Channel

I have a list of keywords:

"Phone Rebooted","Phone Restarted","Phone Restarting","Phone Rebooting","Phone Restart","Phone Reboot","Phone starting resetting","Phone started resetting","Phone started to reset","Phone just reset","Phone just restarted","phone restarted","Phone is restarting","VPN Tunnel Failure", "phone randomly restarted"

 

I am needing to create a flow to a Teams Channel. I see what looks like an option to use a power automate keywords object to select a team channel. Looks simple enough, but I am getting an error that I cannot use phrases, only single words.

 

Question:

In a Teams Channel, how do I use a automatic trigger to kick off a flow when one of the phrases I mentioned above is in a new conversation or a reply to an existing conversation?

 

Thanks in advance for any insights!

1 ACCEPTED SOLUTION

Accepted Solutions
CraigStewart
Super User
Super User

You could split your phrases to single words for the trigger so

"Phone Rebooted","Phone Restarted","Phone Restarting","Phone Rebooting","Phone Restart","Phone Reboot"

 

would become

"Phone", "Rebooted","Pestarted","Restarting","Rebooting","Restart","Reboot"

 

Then use a condition to see if the actual phrases are mentioned by getting the message details first

CraigStewart_0-1664485488712.png

 

For your conditions it's probably best to add toLower() around it and set all your contains to lower case

something like this:

toLower(outputs('Get_message_details')?['body/body/content'])
 
That way your keywords are not case sensitive, and because your conditions are you need to switch them.
CraigStewart_1-1664486228988.png
Here I added PhOne ReStart in the chat which triggered the flow, without changing to lowercase it would fail the condition.
CraigStewart_2-1664486271014.png

Hope that is useful.

 

Cheers

 

Craig

 

View solution in original post

3 REPLIES 3
CraigStewart
Super User
Super User

You could split your phrases to single words for the trigger so

"Phone Rebooted","Phone Restarted","Phone Restarting","Phone Rebooting","Phone Restart","Phone Reboot"

 

would become

"Phone", "Rebooted","Pestarted","Restarting","Rebooting","Restart","Reboot"

 

Then use a condition to see if the actual phrases are mentioned by getting the message details first

CraigStewart_0-1664485488712.png

 

For your conditions it's probably best to add toLower() around it and set all your contains to lower case

something like this:

toLower(outputs('Get_message_details')?['body/body/content'])
 
That way your keywords are not case sensitive, and because your conditions are you need to switch them.
CraigStewart_1-1664486228988.png
Here I added PhOne ReStart in the chat which triggered the flow, without changing to lowercase it would fail the condition.
CraigStewart_2-1664486271014.png

Hope that is useful.

 

Cheers

 

Craig

 

That worked great! One additional thing to note for future readers, conditional evaluations are limited to 10, so if you have more than 10 you need to nest an additional condition under the no of the first condition to do an additional 10. 

CraigStewart
Super User
Super User

Hi JPey,

 

You don't need a nested condition - you can add your conditions as groups instead of rows that allows you to have 10 groups with 10 conditions which is a lot neater.

CraigStewart_0-1664568004326.png

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,562)