Power Automate : Mention a user in an Adaptive Card (Teams Notification)
Mentioning a user on Teams using Power Automate seems to be a simple process when you get a token and use the token on a 'Post message in a chat or channel' activity. It looks as simple as this.
For prettier notifications, we would like to leverage adaptive card capabilities and when you use an Adaptive card, the mention token is technically useless and just cant use it. But there is a round about way to mention a user. You need to know the below three things :
1. User Principal Name of the user
2. Display Name of the User
3. User ID for the User who you are mentioning
With all the above details, we could mention a specific user in Adaptive card in this following way :
# You should have a TextBlock where the mentioned user data to be specified as below
{
"type": "TextBlock",
"text": "Hi <at>place the UPN of the user here</at>"
}
# The msteams entities are mentioned at the end of the adaptive card
"msteams": {
"entities": [
{
"type": "mention",
"text": "<at>place the UPN of the user here</at>",
"mentioned": {
"id": "place the user id guid",
"name": "Display name of the user"
}
}
]
}
Comments