web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Creating Adaptive Card...
Power Automate
Unanswered

Creating Adaptive Cards with mentions dynamically

(0) ShareShare
ReportReport
Posted on by

Hello,

 

We are sending adaptive cards using an incoming webhook (Adaptive Card).

We are also using mentions to tag users according to their email addresses. This works fine. 

Internally, before sending the card to MS Teams, we use placeholders to provide user information and replace our placeholders with either user information or an empty value.

 

Please find below our adaptive card format before placeholder evaluation:

 

 

 

 

 

{
 "type": "message",
 "attachments":
 [
 {
 "contentType": "application/vnd.microsoft.card.adaptive",
 "content":
 {
 "type": "AdaptiveCard",
 "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
 "version": "1.2",
 "body":
 [
 {
 "type": "TextBlock",
 "text": "Updated item",
 "size": "Large",
 "weight": "Bolder",
 "style": "heading",
 "wrap": true
 },
 {
 "type": "TextBlock",
 "text": "<at>#{assigneeName}</at>, the item has been updated.",
 "wrap": true
 },
 {
 "type": "FactSet",
 "facts":
 [
 {
 "title": "Title",
 "value": "#{title}"
 },
 {
 "title": "Type",
 "value": "#{type}"
 }
 ]
 },
 {
 "type": "ActionSet",
 "actions":
 [
 {
 "type": "Action.OpenUrl",
 "title": "Open item link",
 "url": "https://powerusers.microsoft.com",
 "id": "Dummy"
 }
 ]
 }
 ],
 "msteams":
 {
 "entities":
 [
 {
 "type": "mention",
 "text": "<at>#{assigneeName}</at>",
 "mentioned":
 {
 "id": "#{assigneeId}",
 "name": "#{assigneeName}"
 }
 }
 ]
 }
 }
 }
 ]
}

 

 

 

 

 

When our variables assigneeId and assigneeName are not empty, user information is provided in the payload and the adaptive card is created properly. 

However, we noticed that the adaptive card is not created at all if the variables assigneeId and assigneeName are resolved as empty strings. In addition, no error message is returned by the incoming webhook. Only a 200 error code is sent back. 

 

We also tried to remove the 'at mention' in the text block and let the mention block below but we got the same result: the adaptive card can't be created. 

 

Is there a property from the mention entity we could leverage to ignore the mention?

Alternatively, can we use a generic mention like @General as a fallback? 

Any suggestions would be appreciated. 

 

Thanks and best regards,
Sophie

Categories:
I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard