'How to capture reaction of an emoji to a message in Microsoft Team

Is there a way to capture the reaction/emojies on messages in Microsoft Teams using Microsoft Teams webhook (I'm coding in python)? If not can I do this using other tools ( Microsoft Graph, Power Apps, Power Automate, etc.).

I am using Microsoft Team Webhook to post message into Teams Channel, now I am trying to capture user reactions to each message and saved them in a database. Is there a way to get access to reactions? It would be great if I can do it by using current Webhook that I have.

Here is the function I am using to post the message to Microsoft Teams.

def sendMessageToTeams(webHookUrl: str,msg: str):
    try:
        # escaping underscores to avoid alerts in italics.
        msg = msg.replace('_', '\_')
        teams_msg = pymsteams.connectorcard(webHookUrl)
        teams_msg.text(f'{msg}')
        teams_msg.send()
    except Exception as e:
        print(f'failed to send alert: {str(e)}')


Solution 1:[1]

You can send messages to Teams channel using webhook. You can post messages by setting up incoming webhook within channel. Please look at https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/add-incoming-webhook .
But you should specify your requirement you can achieve this with the Bot. A bot is also helpful to have conversation within Teams channel. Bot supported [Personal, Team, GroupChat] scope. Please go through the Conversation basic https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/conversation-basics?tabs=dotnet#send-a-message for more information how bot works within different scopes.

Solution 2:[2]

Thanks Sayali. My first answer got deleted because it only referred to the link. So I added the detailed steps from the link. I didn't have issue to sent message, reactions to Team, my problem was on how to capture the reaction to previous messages. I finally found the answer by following the instruction on the following link which is self explanatory.

https://powerusers.microsoft.com/t5/Building-Flows/Collecting-Reactions-from-Teams-Messages/td-p/822090

Here is the steps form the post, I thought its better to simply refer to link, however received some comment to put the main steps here. So here we go:

enter image description here

Explanation:

1.Get messages 2.Go into an apply each loop for each message. 3.The reactions array associated with each message is filtered to match every type of reaction. 4.A compose action outputs the message ID along with the length of each reaction array (the count of each reaction type). 5.The final array of results is produced outside of the apply-each loop.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sayali-MSFT
Solution 2 Shahin Shirazi