How to use @mention in facts in a Teams MessageCard ?

Dylan 20 Reputation points
2023-03-07T15:13:00.19+00:00

Hi,

As the example below, given by Microsoft at https://learn.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using?tabs=cURL, I would like to reuse this exact same MessageCard with the "table" part ("facts" in code) and implement a user mention instead of "Unassigned".
Screenshot of a coonector card.

I can create two cards, one with a simple mention Like "Hi @User", and another with a table, but I can't fuse them together, the code structures aren't really the same.

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,065 questions
{count} votes

Accepted answer
  1. Sayali-MSFT 2,266 Reputation points Microsoft Vendor
    2023-03-09T10:29:59.7933333+00:00

    You can add @mentions within an Adaptive Card body for bots and message extension responses. like below-
    If you want to use FactSet please refer the below sample-
    https://github.com/OfficeDev/Microsoft-Teams-Samples/blob/391b4de9daf91e6b1befa73214b04ad4736f36a1/samples/bot-sequential-flow-adaptive-cards/csharp/SequentialUserSpecificFlow/Resources/rejectedCard.json

    {
      "contentType": "application/vnd.microsoft.card.adaptive",
      "content": {
        "type": "AdaptiveCard",
        "body": [
          {
            "type": "TextBlock",
            "text": "Hi <at>John Doe</at>"
          }
        ],
        "$schema": "https://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.0",
        "msteams": {
          "entities": [
            {
              "type": "mention",
              "text": "<at>John Doe</at>",
              "mentioned": {
                "id": "29:123124124124",
                "name": "John Doe"
              }
            }
          ]
        }
      }
    }
    
    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful