cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bolin-stratus
Continued Contributor
Continued Contributor

Send An Adaptive Cards to Teams With an @Mention - Requires a Teams User ID (How Do I Get This ID?)

I can successfully send an adaptive card from Power Automate to Teams, but I'd like the card to generate an @mention.  I have the JSON code for adaptive cards but in order to @mention a user, I need their Teams user ID.  How can I determine a user's Teams ID if I am not using a bot?  See: Sample Adaptive card with a mention  

 

{
  "contentType": "application/vnd.microsoft.card.adaptive",
  "content": {
    "type": "AdaptiveCard",
    "body": [
      {
        "type": "TextBlock",
        "text": "Hi <at>John Doe</at>"
      }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.0",
    "msteams": {
      "entities": [
        {
          "type": "mention",
          "text": "<at>John Doe</at>",
          "mentioned": {
            "id": "29:123124124124",
            "name": "John Doe"
          }
        }
      ]
    }
  }
}

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

To determine user's ID in Teams requires PowerShell and the Teams PS module. 


Connect-MicrosoftTeams

 

Retrieve Group IDs for Sites a User is Assigned:
Get-Team -User first.last@abc.com

Teams-PS-to-Determine-Group-IDs.png

Use Group ID to Retrieve All User IDs for a Teams Site:
Get-TeamUser -GroupId INSERT-GROUP-ID-HERE

Teams-PS-to-Determine-a-User-ID.png

This will list all user IDs for a specific Teams site. This user ID is the same across all Teams site in that tenant. 

The JSON code for adaptive cards requires a user's Teams user ID for using an @mention in a Power Automate as shown in the initial post.

View solution in original post

2 REPLIES 2
bolin-stratus
Continued Contributor
Continued Contributor

Anyone have any recommendations? 

To determine user's ID in Teams requires PowerShell and the Teams PS module. 


Connect-MicrosoftTeams

 

Retrieve Group IDs for Sites a User is Assigned:
Get-Team -User first.last@abc.com

Teams-PS-to-Determine-Group-IDs.png

Use Group ID to Retrieve All User IDs for a Teams Site:
Get-TeamUser -GroupId INSERT-GROUP-ID-HERE

Teams-PS-to-Determine-a-User-ID.png

This will list all user IDs for a specific Teams site. This user ID is the same across all Teams site in that tenant. 

The JSON code for adaptive cards requires a user's Teams user ID for using an @mention in a Power Automate as shown in the initial post.

View solution in original post

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.

Users online (1,130)