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

Send email with username and body content of message from a Teams channel?

Hey all! I'm trying to create a simple email system that is sent out whenever an agent sends a message in the "Help" channel and says a specific keyword (in this case, "aux").

 

The goal is to have agents send the messauge AUX, and then power automate to reply with a bot message and then send an email to a specific set of people with the users name and message content.

 

Seems the only way to get the message content and username ID is to add "get messages" however doing so gets ALL messages, and while there is a way to filter for the specified keyword, it still enters all of the user messages that include the keyword and replies to the one message but then sends an email per every other teams message.

 

This is what I would like to happen:

 

Agent types: Hey, I need help with my aux state, can someone help?

Bot reply in MS Teams: Hey! An email has been sent to the team, please keep an eye out for a reply

Email sent from PA to team: Subject: Aux request, Body: Hey, USERNAME requests an aux check. Here is the following message content: MESSAGECONTENT

 

I apologize for lack of pictures, I am using mobile and its not working. My workplace prevents access from outside of the iMac so I dont have direct access to it from my iMac either. Weird situation but I do have access to allowing bots and stuff (and have it working for other keywords)

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Super User
Super User

Hi @mvfsullivan 

 

There is a new Teams trigger that will look for a value in a channel message.  You can then get the message details and see who the sender was as well as get the message content.

 

DamoBird365_0-1631565200748.png

Flow will attempt to put you into an apply to each.  So I have used first() as follows:

 

first(triggerOutputs()?['body/value'])?['messageid']
first(triggerOutputs()?['body/value'])?['teamid']
first(triggerOutputs()?['body/value'])?['channelid']
 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

View solution in original post

4 REPLIES 4
DamoBird365
Super User
Super User

Hi @mvfsullivan 

 

There is a new Teams trigger that will look for a value in a channel message.  You can then get the message details and see who the sender was as well as get the message content.

 

DamoBird365_0-1631565200748.png

Flow will attempt to put you into an apply to each.  So I have used first() as follows:

 

first(triggerOutputs()?['body/value'])?['messageid']
first(triggerOutputs()?['body/value'])?['teamid']
first(triggerOutputs()?['body/value'])?['channelid']
 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

View solution in original post

I did exactly as you have and testing results in "Not Found". 

 

It does give me the ability to insert body content / username in the email body section but testing doesnt move past the messageid not found.

 

Am I doing something wrong?

Hi @mvfsullivan ,

 

Are you getting an error?  Can you share a screenshot of your flow and also one of the error?

 

Damien

mvfsullivan
Regular Visitor

Issue is resolved via the above post. I was just not adding the rest of my flow which left it unfinished. Noob mistake 😄

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,015)