Using the new ‘Send a Microsoft Graph HTTP request’ action in Power Automate to send urgent messages in Microsoft Teams chats/channels

One limitation we have in Power Automate’s standard Microsoft Teams actions is the inability to send high messages flagged as URGENT on Teams.

However, with the new ‘Send a Microsoft Graph HTTP request’ action, we can overcome this issue and send messages flagged as urgent in Microsoft teams, enhancing our communication automation capabilities within Teams and Power Automate.

The Microsoft Graph Request needed & Action in Power Automate

To send a teams message via Graph, you need to send a request body representing the chatMessage object.

This object has an property named importance.

When creating a message as urgent, we need to set the importance of the message as urgent (this property accepts the following values: urgent, high and normal).

Then we run a POST request against the specific Microsoft Graph Endpoints (depending if we are either sending a message in a chat or channel conversation) using the message body we constructed.

For a sample call in Power Automate you can use the following sample setup, for conversations or channel messages:

1:1 Chats or Group Chats

To send an urgent message in a group chat or 1:1 conversation we can run a POST request against the following graph endpoint:

https://graph.microsoft.com/v1.0/me/chats/<chat id>/messages

Sample request body:

{   
  "importance": "urgent",
  "body": {
    "content": "This is an urgent message" },
}

Sample action in Power Automate:

Chanel Conversations

To send an urgent message on a Channel conversation we can run a POST request against the following graph endpoint:

https://graph.microsoft.com/v1.0/teams/<team id>/channels/<channel ID>/messages

Sample request body:

{   
  "importance": "urgent",
  "body": {
    "content": "This is an urgent message, please reply to me ASAP!!!!!" },
}

Sample action in Power Automate:

Result

After executing the graph HTTP request in a Flow, you will properly get the urgent message sent.

Group Chat or 1:1 chat:

Channel conversation:

Conclusion

Microsoft Graph can now be used easily with standard Power Platform Teams connector to enhance communication workflows and to send messages on Teams via Power Automate.

Even though the available actions through the new ‘Send a Microsoft Graph HTTP request’ are limited, we can explore a few more possibilities that are not doable using the standard actions, and that previously would require a more complex setup to use Microsoft Graph in Power Automate (and also those alternative approaches would require premium licenses, while the Teams connection action is a standard one).

References

Send chatMessage in a channel or chat – Microsoft Learn

chatMessage resource type – Microsoft Learn

2 comments

Leave a Reply

Your email address will not be published. Required fields are marked *