
Announcements
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