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 😉

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
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,098)