Step 1: Trigger
Use:
Trigger: When a new channel message is added (v3)
Team: Test
Channel: Questions
Only process replies: Add a condition to ensure replyToId is not null (because we're only interested in replies)
Step 2: Get the original message (root post)
Action: Get message details
Message ID: @{triggerOutputs()?['body/replyToId']}
Team: Test
Channel: Questions
This fetches the original question you're replying to.
Step 3: Check mentions in your reply
Action: Condition or Switch
Check if the reply message contains specific keywords like:
@{contains(triggerOutputs()?['body/body/content'], 'HR')}
@{contains(triggerOutputs()?['body/body/content'], 'Finance')}
Microsoft Teams "mentions" appear as rich text, not plain @HR, so the real text might include HTML like:
<a href="https://teams.microsoft.com/l/entity/..." data-mention="HR">HR</a>
So, for better reliability, use:
Expression to normalize text:
toLower(triggerOutputs()?['body/body/content'])
Then check for the presence of "hr" or "finance" in the cleaned string.
Step 4: Post to HR Channel (If Mentioned)
Action: Post a message in a chat or channel
Post as: Flow bot
Team: Test
Channel: HR
Message:
markdown
Forwarded from Questions channel:*
**Original Question:**
@{outputs('Get_message_details')?['body/body/content']}
Step 5: Post to Finance Channel (If Mentioned)
Same action, just target the Finance channel.
If I have answered your question, please mark it as the preferred solution ✅ . If you like my response, please give it a Thumbs Up 👍.
Regards,
Riyaz