DEV Community

Discussion on: Use adaptive cards with mention in Microsoft Teams

 
kenakamu profile image
Kenichiro Nakamura

I am also curious about this. Appreciate if anyone can share any findings!

Thread Thread
 
bmesft profile image
Andrew

Has anyone been able to figure this one out? I am getting the same issues as most here, the user "link" is blue, but there is no action or mention created. I checked that the id is correct by doing a mention and inspecting the page to make sure I was using the correct ID. I am just sending the adaptive card using a webhook.

Thread Thread
 
jonasbjoralt profile image
Jonas Bjøralt

Hi, I was able to get it to work by replacing the id with my email. Here's the full JSON:

{
    "type": "message",
    "attachments": [
      {
        "contentType": "application/vnd.microsoft.card.adaptive",
        "content": {
          "type": "AdaptiveCard",
          "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
          "version": "1.4",
          "body": [
            {
              "type": "ColumnSet",
              "columns": [
                {
                  "type": "Column",
                  "width": 2,
                  "items": [
                    {
                      "type": "TextBlock",
                      "text": "<at>John Doe</at> you should really see this.. ",
                      "wrap": true
                    }
                  ]
                }
              ]
            }
          ],
          "msteams": {
            "entities": [
              {
                "type": "mention",
                "text": "<at>John Doe</at>",
                "mentioned": {
                  "id": "john@example.com",
                  "name": "John Doe"
                }
              }
            ]
          }
        }
      }
    ]
  }

Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
nemopeti profile image
Kovács Péter

Save my day, that worked to me also with email address :)

Thread Thread
 
kenakamu profile image
Kenichiro Nakamura

I am glad to hear that!