How do I mention a MS Teams "Tag" in a FactSet (Adaptive Card)

Manuel Rodriguez 0 Reputation points
2024-11-21T22:45:28.23+00:00

Hi can I please have an example on how to use channel Tags as mentions for an adaptive card? It works directly in the channel by "@TAG_NAME"

However, in the code, I cant seem to get it to work in a fastest or Textblock, while using mentions or msteams.entities

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,895 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,415 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,752 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ki-lianK-7341 850 Reputation points
    2024-11-22T06:45:10.2166667+00:00

    To mention a Microsoft Teams “Tag” in an Adaptive Card, you need to use the msteams property within the card’s JSON payload. Here’s an example of how you can do this:

    
    {
      "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
      "type": "AdaptiveCard",
      "version": "1.2",
      "body": [
        {
          "type": "TextBlock",
          "text": "Hello @<at>TAG_NAME</at>!"
        }
      ],
      "msteams": {
        "entities": [
          {
            "type": "mention",
            "text": "<at>TAG_NAME</at>",
            "mentioned": {
              "id": "TAG_ID",
              "name": "TAG_NAME"
            }
          }
        ]
      }
    }
    
    

    In this example:

    • Replace TAG_NAME with the name of your tag.
    • Replace TAG_ID with the ID of your tag.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.