How to Get All Mentions from a Teams Message

Luz 45 Reputation points
2026-01-08T17:19:17.6366667+00:00

Hello! I want to update an Excel sheet whenever someone posts in a specific Teams channel. I need to capture all mentions. I have created a workflow using Power Automate to get other information from Teams messages, but I haven't been able to figure out a way to get the mentions.

From what I've seen, the general way to do this would be to Initialize a string Variable named "Mentions" to empty. Then add an Apply to Each over "Mentions". But when I've tried to create an Apply to Each I haven't been able to get the data from the Get Message Details output.

If anyone could give me guidance or point me to good documentation/ a tutorial it would be greatly appreciated!


Moved from: Microsoft 365 and Office | Other

Microsoft 365 and Office | Excel | For business | Other
0 comments No comments

Answer accepted by question author
Tina L 12,340 Reputation points Microsoft External Staff Moderator
2026-01-09T11:52:05.1766667+00:00

Hello @Luz

Thank you for reaching out to the Q&A forum! 

After reading your message, I reviewed your previous conversation with Francisco Montilla, and I also ran several tests in my own environment. By checking the Raw Outputs of the Get message details action, I was able to successfully extract the mentions; so, I’ll share the exact steps that worked for me. 

Since you already configured When a new channel message is added and Get message details, I won’t repeat those steps. Here are detail next steps: 

1.Before adding the Apply to each step, please add an “Initialize variable” action as follows: 

  • Name: Mentions 
  • Type: String 
  • Value: (you can leave this empty) 

User's image

2.Next, you need to add an Apply to each, in Select an output from previous steps, you can enter the following expression: body('Get_message_details')?['mentions']   

User's image

3.Inside the loop, you add “Append to string variable”: 

  • Variable name: Mentions 
  • Value: concat(coalesce(items('Apply_to_each')?['mentioned']?['user']?['displayName'], items('Apply_to_each')?['mentionText']), ', ')  

User's image

4.Finally, you add Add a row into a table. In my test table, I used the following columns: Message, PostedAt, Mentions.  

For the Mentions column, you can simply enter: variables('Mentions')   

User's image

After saving the flow and posting a test message with mentions, everything worked successfully on my side. 

User's image

Looking forward to hearing from you! 


If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

Was this answer helpful?


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.