web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Suggested Answer

ReplyToId

(1) ShareShare
ReportReport
Posted on by 2
I am trying to use trigger when message us added to a chat or channel, encountering to issues, 
a) how do i figure out if the message posted is by a bot or a genuine user
b) if message is a reply or a new message.
 
for a) i am using condition application id is equal to null, so that if it is null that means its not a bot/application but a user
 
for b) i tried replytoid but in that case, even if i put the message right after my previous message , it considers it as a replytoid and then goes to reply to branch.
 
 
”the whole flow should be something like below,
if the user post a message in a teams group chat than post the same message to a teams channel, also if it is a reply to a message than give what the user has replied to , with the replied message.
I have the same question (0)
  • Suggested answer
    CurtisAmrein Profile Picture
    38 on at
    Two points:
     
    Do you need anything to happen if the message is a reply? If not, you could use the "When a new channel message is added" trigger instead? Then it doesn't trigger on replies.
     
    However, you mention a reply branch, so let's presume you do need something to happen. Every message has a replyToMessageId...but if the message is a new post, then the replyToMessageId equals the messageId. That's what we can use to build our condition:
     
     
    To determine if the message is from a bot or not, we have to use the Get message details action since the trigger doesn't tell us. Make sure to put the replyToMessageId in the "Parent Message ID" field. It's only required if the message is a reply, but the designer will let you get away with leaving it blank (and then the flow will fail for replies).
     
    Finally, we can add the From Application output of the Get message details action and add it to our condition...if it's null, then we know a human sent the message and we should proceed (in my flow, I have it sending a reply in this case):
     
     
    That should do it! Here is the whole flow...the Apply to each/for each loop appeared in both the new and classic designer, and the flow breaks without it even though it should seem not necessary. I believe it is because of how the trigger output is structured, so I just left it alone.

     
    That's it! Please mark this reply useful and/or verify the answer if I was helpful. Thanks!
     
    Curtis Amrein

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard