Microsoft Teams
A Microsoft customizable chat-based workspace.
9,074 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have the following MS teams card:
which is described by JSON
{
"@type": "AdaptiveCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "Summary",
"sections": [
{
"facts": [
{
"name": "People to Mention",
"value": "[Mary](user@main.com) <at>0</at>"
}
],
"markdown": "true"
}
],
"potentialAction": [
{
"@type": "OpenUri",
"name": "Go to Another MS teams channel",
"targets": [
{
"os": "default",
"uri": "https://teams.microsoft.com/l/channel/...."
}
]
}
],
"msteams": {
"entities": [
{
"type": "mention",
"text": "<at>0</at>",
"mentioned": {
"id": "user@mail.comr",
"name": "John"
}
}
]
}
}
The problem is I am not able to mention people. I could manage to effectively mention people with the JSON below
{
"type": "message",
"attachments": [
{
"version": "1.0",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"spacing": "small",
"text": "<at>0</at>"
}
],
"msteams": {
"entities": [
{
"type": "mention",
"text": "<at>0</at>",
"mentioned": {
"id": "user@mail.com",
"name": "name"
}
}
]
}
}
}
]
}
And the result was
As you could have notice, the problem seems to be that {@type: "Adaptive"} and {"type": "message"} behave differently so that I wasn't able to combine what I nedd from both of them into one Card.
Any suugestions on how to mention users and place the "go to button" in the same card?
To mention users and add a "go to" button in the same card in Microsoft Teams, you can use the Adaptive Card feature. Adaptive Cards allow you to create interactive cards that include various elements, such as text, images, and buttons.
Here's an example of how you can create an Adaptive Card that mentions users and includes a "go to" button:
Copy code
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Hello, @user1 @user2"
},
{
"type": "TextBlock",
"text": "Please click the button to go to the link"
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.OpenUrl",
"title": "Go to link",
"url": "https://www.example.com"
}
]
}
]
}
In this example, you can see that the card includes a "TextBlock" element for the message that mentions the users with the "@" symbol, and it also includes an "ActionSet" element that contains an "Action.OpenUrl" button with a title of "Go to link" and a specified URL to open.
You can also use the Microsoft Teams SDK to create the card and send it to a specific channel or user.
You can also use the Microsoft Teams SDK to create the card and send it to