cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bolin-stratus
Post Partisan
Post Partisan

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
Post Partisan
Post Partisan

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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,376)