Adaptive Card is very flexible way to create rich card which I can send to many platform. One of the platform is Microsoft Teams.
What's more interesting is that Power Automate can send Adaptive Card now.
Use adaptive cards in Microsoft Teams
One thing I couldn't figure out was how to "mention" people. There is a document Mention support within Adaptive cards and it says
The mention object inside of an msteams property in the card content, which includes the Teams user id of the user being mentioned
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"text": "Hi <at>John Doe</at>"
}
],
"$schema": "http://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"
}
}
]
}
}
}
The question was how to get the Teams user id.
I found an thread discussing this at Ms Teams @ Mentions in adaptive cards and at the end, it seems like I just need to use 8:orgid:{org-ID-of-the-user} format like below.
"entities": [
{
"type": "mention",
"text": "<at>Kenichiro Nakamura</at>",
"mentioned": {
"id": "8:orgid:{org-ID-of-the-user}",
"name": "Kenichiro Nakamura"
}
}
]
Now I can simply use any way to get the user id, such as Graph Explorer.
If the user id is f9e0c5cb-f4ee-43d4-91e2-63524d1bacd9, then the message I send in Power Automate looks like:
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Hi <at>Kenichiro Nakamura</at>"
}
],
"msteams": {
"entities": [
{
"type": "mention",
"text": "<at>Kenichiro Nakamura</at>",
"mentioned": {
"id": "8:orgid:f9e0c5cb-f4ee-43d4-91e2-63524d1bacd9",
"name": "Kenichiro Nakamura"
}
}
]
}
}
Cool :)
Top comments (26)
Hello.
I'd like to send the message which contains @mention with incoming webhook.
However, I couldn't make work @mention with
8:orgid:{org-ID-of-the-user}
.I consider the reason why I couldn't do was
org-ID-of-the-user
was too short,c57b6b553*******
(16 digits), which is got with Graph Explorer(graph.microsoft.com/v1.0/me).As I have no idea to solve this problem, I appreciate if you would let me know the solution.
Thanks in advance.
The user id is guid form one, which you can find from graph results.
for example, this is my result.
Thank you for replying.
This is my result with calling graph.microsoft.com/v1.0/me
I think the format of
id
is a different to from yours.Would you tell me why they are different if you know.
That's interesting which I don't have much idea. And you can query your info via graph.microsoft.com/v1.0/users/ ?
Of cource!
However, it seems that the value is same...
Then I assume that's your user id. Not sure why format is different. So if you create mention by using the id with 8:orgid:{org-ID-of-the-user} , nothing happens?
And check this thread as well please. powerusers.microsoft.com/t5/Buildi...
Yes, it says nothing at all.
It's a sent JSON with incoming webhook URL.
And, the attached image is a message displayed in teams. On hovering the purple message,
John
, there's no reaction.interesting.. i am not sure about the id format. If you are keen to debug in different environment too, you can create trial instance and test. I just did but the id of user was GUID format.
Thank you for taking the time to check it out.
Actually, I can't set up a new trial instance, as it was an technical verifiaction in my company.
Thus, I've concluded to give up on this method for now.
Thank you very much for your help so far.
I am sorry to hear that we couldn't figure out the issue. Why don't you issue support ticket to get more assistance!? Please let me know if you have any further question anytime.
Thank you for the suggestion.
Would you tell me which site I can issue support ticket?
I'd like to do that if I can.
As long as I know, if you may log ticket from Microsoft 365 portal, which may requires some permission. If you cannot do it, you may want to find admin of the tenant to issue the ticket.
I'll contact the admin of my community.
Thank you for that.
Hello, any update on this issue? I am also facing the same issue here. I cant find the orgid. Can anyone help? I am also getting such a b58f56fa8a54b578 from graph query just like @task4233 . Not even the content inside the "at" tags tags are displayed in the teams. Only the text is coming. Someone give me some pointers please?
I am also curious about this. Appreciate if anyone can share any findings!
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.
Hi, I was able to get it to work by replacing the id with my email. Here's the full JSON:
Save my day, that worked to me also with email address :)
I am glad to hear that!
Anyone still following along here I found that I could get the user Id option to work by dropping the 8:orgId: prefix. Hope that helps.
Thanks for your update!
Hello i managed to to mention someone but that person is not alerted and when i hover over his name nothing happens as opposed to a manual mention. Any suggestions?
that's wired.. please check org id is correct.
I am also having this issue; I'm using what I know to be our organization's tenant id. Is the "org id" different?
It's not organization id but organization user id in mention.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.