Using Graph API with Power Automate to create Custom Actions

In this blog post, we use Graph API’s to develop custom actions in Power Automate. Custom actions are any piece of Power Automate functionality that are not provided out-of-box. Microsoft is constantly updating the out-of-box actions in Power Automate. However, there are some instances where the business needs may not be met with only those actions. These use cases require custom development of actions using Graph API and Http Request Action (aka – Http with Azure AD).

To illustrate custom action development, we use posting @Channel mentions in a Teams channel using Graph API and Invoke Http Action.

  • The first step is to declare variables for TeamsID, ChannelID and ChannelPostUrl.
  • Get the channel to post messages using the action – List channels action
  • Set the values of the variables for TeamsID, ChannelID, and ChannelPostUrl
We find the value of TeamsID using the following expression from the [‘WebUrl’] property of Channel: first(slit(last(split(Items(‘Apply_to_each’)[‘WebUrl’], ‘groupId=’)), ‘&tenantId’)) .
  • Use graph API’s POST method in the Invoke an HTTP request action.

In conclusion, using Power Automate and Graph API, the potential for developing custom actions are limitless.

Leave a Reply

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