cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ajjohn14
New Member

Extracting @mentions from Teams to Excel

I am building a flow that "when keywords are mentioned in a Teams channel", a row is added to an Excel table extracting data from that Teams message. We are using @mentions to mention people in our channel, and I am wondering if it's possible to extract that user (will always be a single @mention) into a standalone column in excel. Right now I am just seeing the option to extract the entire message. 

1 ACCEPTED SOLUTION

Accepted Solutions
Rhiassuring
Super User
Super User

Hi there, 

 

This is need is new to me, so I did a little research... 

🦉Even though the keywords trigger doesn't have an asterisk next to teams & channel, it wouldn't let me run it without those populated. (Might not be news to you, though!)

🦉To get the mentions, you need to "Get Message Details". This has two things of note, though: 

1) It will turn into an "Apply to Each" ... which is fine. Just a note.

2) You will need a condition to evaluate two different types of messages: one for messages themselves, and, one for replies to messages. They're handled differently. 

🦉Grab the output from the Get Message Details (run a test of it, so you can use this), and cram it into a Parse JSON. From here, you can access the value called "Mentions" which holds what you need - to get the display name from the mention, use this (works for a single instance): body('Parse_JSON')?['mentions'][0]?['mentioned']?['user']?['displayName']

That'll get you the user, which you can then plop into your Excel sheet.


Does that help? Do you need instruction to get it into Excel itself?

Cheers,


Rhia

 

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



View solution in original post

2 REPLIES 2
Rhiassuring
Super User
Super User

Hi there, 

 

This is need is new to me, so I did a little research... 

🦉Even though the keywords trigger doesn't have an asterisk next to teams & channel, it wouldn't let me run it without those populated. (Might not be news to you, though!)

🦉To get the mentions, you need to "Get Message Details". This has two things of note, though: 

1) It will turn into an "Apply to Each" ... which is fine. Just a note.

2) You will need a condition to evaluate two different types of messages: one for messages themselves, and, one for replies to messages. They're handled differently. 

🦉Grab the output from the Get Message Details (run a test of it, so you can use this), and cram it into a Parse JSON. From here, you can access the value called "Mentions" which holds what you need - to get the display name from the mention, use this (works for a single instance): body('Parse_JSON')?['mentions'][0]?['mentioned']?['user']?['displayName']

That'll get you the user, which you can then plop into your Excel sheet.


Does that help? Do you need instruction to get it into Excel itself?

Cheers,


Rhia

 

______________________________________________________________


Did this answer your question? Please mark it as the solution.
Did it contribute positively towards finding the final solution? Please give it a thumbs up.

I answer questions on the forum for 2-3 hours every Thursday!



Rhia, Thank you SO much!! This works perfectly for me, and I appreciate your detail in your message.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,268)