Mentions (<at> Tags) Doesn't Work in Nested Elements Like TableCell in Adaptive Cards

Selim SARIALTIN 20 Reputation points
2024-11-21T00:16:24.48+00:00

I am creating a table in my Adaptive Card and want to tag people inside the cells. However, this doesn't seem to be possible. If I use the mention in a top-level TextBlock, it works though. Could you please help me with this issue?

My Adaptive Card looks like this:

card = {
    "type": "message",
    "attachments": [
        {
            "contentType": "application/vnd.microsoft.card.adaptive",
            "content": {
                "type": "AdaptiveCard",
                "version": "1.4",
                "width": "stretch",
                "body": [
                    {
                        "type": "TextBlock",
                        "text": "This is my table",
                    },
                    {
                        "type": "Table",
                        "columns": [
                            {
                                "type": "TableColumn",
                                "width": "stretch"
                            },
                            {
                                "type": "TableColumn",
                                "width": "stretch"
                            }
                        ],
                        "rows": [
                            {
                                "type": "TableRow",
                                "cells": [
                                    {
                                        "type": "TableCell",
                                        "items": [
                                            {
                                                "type": "TextBlock",
                                                "text": "",
                                            }
                                        ]
                                    },
                                    {
                                        "type": "TableCell",
                                        "items": [
                                            {
                                                "type": "TextBlock",
                                                "text": "Col 2",
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "type": "TableRow",
                                "cells": [
                                    {
                                        "type": "TableCell",
                                        "items": [
                                            {
                                                "type": "TextBlock",
                                                "text": "Row 1",
                                            }
                                        ]
                                    },
                                    {
                                        "type": "TableCell",
                                        "items": [
                                            {
                                                "type": "TextBlock",
                                                "text": "<at>Miles GOLD</at>",
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ],
                "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                "msteams": { 
                    "width": "full",
                    "entities": [
                        {
                            "type": "mention",
                            "text": "<at>Miles GOLD</at>",
                            "mentioned": {
                                "id": "******@gmail.com",
                                "name": "Miles GOLD"
                            }
                        }
                    ]
                }
            }
        }
    ]
}
Microsoft Teams | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

Answer accepted by question author
  1. Sayali-MSFT 4,341 Reputation points Microsoft External Staff Moderator
    2024-11-21T12:33:20.6466667+00:00

    Hello @Selim SARIALTIN,
    Currently, Adaptive Cards do not support the mention feature within table cells.
    For information regarding Adaptive Card mentions, you can refer to this:
    https://learn.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?tabs=adaptive-md%2Cdesktop%2Cdesktop1%2Cdesktop2%2Cconnector-html#mention-support-within-adaptive-cards

    Thank you for your suggestion! To better achieve your requirements, we recommend submitting this feature request through the Teams Feedback Portal. This is the best way to ensure your idea is considered for future updates. 

    We appreciate your input and encourage you to share any additional thoughts! 


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.