cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoshE
Frequent Visitor

Can I get the @mention token for user to display the user's name instead of their email address?

I am working with custom/complex adaptive cards and I am trying to use the @mention token for a user in the card. After a lot of digging, I finally got it to work, but it is displaying the user's email/principle name instead of the Display Name. 

 

Below is an image of my adaptive card JSON. The trials in getting the @mention to work in my card meant I had to use a TextBlock, rather than a RichTextBlock. Also, I did not include the section that was mentioned in other posts such as this one; https://poszytek.eu/en/microsoft-en/office-365-en/powerautomate-en/mentioning-in-microsoft-teams-via... 

specifically, the bit referencing this page: https://docs.microsoft.com/en-us/microsoftteams/platform/task-modules-and-cards/cards/cards-format?t... 

Adaptive Card Json w/ @mention tokenAdaptive Card Json w/ @mention token

 

 

 

Snip of resulting adaptive card with @mention tokenSnip of resulting adaptive card with @mention token

 

If you look at the first link I provided (Link ) you can see the resulting adaptive card has the Display Name of the @mention'd person, while in mine it shows the user's email/principal name.

 

Any help with this?

1 ACCEPTED SOLUTION

Accepted Solutions
JoshE
Frequent Visitor

So I did find a solution, but it was to not use the @mention token action at all. If you do what one of the links above says and copy this to the (near) end of your card you can then use a textbox and write in <at>name here</at> and it will output as an @token.

 

            "msteams": {
                "entities": [
                    {
                        "type": "mention",
                        "text": "<at>John Doe</at>",
                        "mentioned": {
                            "id": "xxxxxxxx",
                            "name": "John Doe"
                        }
                    },

 

View solution in original post

2 REPLIES 2
JoshE
Frequent Visitor

So I did find a solution, but it was to not use the @mention token action at all. If you do what one of the links above says and copy this to the (near) end of your card you can then use a textbox and write in <at>name here</at> and it will output as an @token.

 

            "msteams": {
                "entities": [
                    {
                        "type": "mention",
                        "text": "<at>John Doe</at>",
                        "mentioned": {
                            "id": "xxxxxxxx",
                            "name": "John Doe"
                        }
                    },

 

View solution in original post

Hi @JoshE :

Thanks for your solution,I will be helpful to others.

Best Regards,

Bof

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,621)