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.
Solved! Go to Solution.
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
I answer questions on the forum for 2-3 hours every Thursday!
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
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.