DEV Community

Cover image for How to mention users (and @Everyone) in a Teams group chat from Power Automate
Wilchin Dipolog
Wilchin Dipolog

Posted on

How to mention users (and @Everyone) in a Teams group chat from Power Automate

Currently, Power Automate does not provide a built-in action to use the @Everyone feature in Microsoft Teams group chats.
If you want to automatically notify individual all members of a chat, you need to use the Microsoft Graph API and include proper mentions in the message payload.

This guide shows how to create messages that mention @everyone in a Teams chat using Power Automate.

Step 1: Extract Teams Group Chat ID

  • Click Run Query
  • Under Response pre view, find this:

  • Copy it to Notepad (this will be used in the flow).
19:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@thread.v2
Enter fullscreen mode Exit fullscreen mode

Step 2: Power Automate Flow

Actions

  1. Trigger:
    • Manually trigger a flow (or any trigger you want).
  2. Initialize Variable:
    • Name: GroupId
    • Type: String
    • Value: <paste your chat ID>
  3. Send a Microsoft Graph HTTP request:
    • URI: https://graph.microsoft.com/v1.0/me/chats/@{variables('GroupId')}/messages
    • Method: POST
    • Body:
{
  "importance": "high",
  "body": {
    "contentType": "html",
    "content": "Hi <at id=\"0\">Everyone</at>"
  },
  "mentions": [
    {
      "id": 0,
      "mentionText": "Everyone",
      "mentioned": {
        "conversation": {
          "id": "@{variables('GroupId')}"
        },
        "displayName": "Everyone"
      }
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode
  • Content-type: application/json

Using Microsoft Graph in Power Automate is currently the only way to programmatically mention @Everyone in a Teams group chat. By following the steps above, you can ensure that your message properly notifies everyone without errors, keeping your team informed efficiently. This approach is reliable, lightweight, and works directly with the chat’s conversation ID, giving you full control over mentions in automated workflows.

Top comments (0)