That one announcement, that made me very happy to read: An action in Power Automate to perform an HTTP request via the Microsoft Teams actions. After having a first look, I am still missing important things.
Why is this new action important?
Imagine you want to create teams automatically via Power Automate. For example, because you've written an Audit Management Power App. In this app Teams are created for every audit. So far so good: with a simple flow that uses the standard actions to create a Team.
What's not possible right now?
Let's add one simple requirement: create a private channel. With the Microsoft Teams actions it's only possible to create a public channel, not a private one.
Graph API - please save us!
The good thing: there were always opportunities to create a private channel via the Graph API. Just check out this reference and implement it with your preferred...
- Custom Connector
- HTTP Request action
- HTTP Request via SharePoint, Office Groups etc.
To be honest? Custom Connectors are super cool and the best. But also a hassle regarding API registration, solution management (first needs to be imported, before you can import your solution with a connection reference, add the secrets in the new environment etc.) and credential management.
HTTP Request needs you to get the bearer token first, store the credentials in a save place like Azure Key Vault. And of course, both ways require licenses to start a premium workflow.
So, why not use the SharePoint HTTP action? To be honest - it works. But that was also the case for HTTP action of Office Groups. With V2 it doesn't anymore, the V1 is deprecated and there starts the trouble.
Who can guarantee, that the SharePoint HTTP action will work tomorrow or in a month? So Teams HTTP action sounds like a solid approach - which probably (or more hopefully?) will still work tomorrow. Let me explain, how to work with the new action.
The implementation - create a private channel
Use the action "Create team" and afterwards use a POST call to the endpoint https://graph.microsoft.com/v1.0/teams/{team-id}/channels. Now copy and paste the body which is shared in example 2 of the documentation and you are nearly good to go.
One thing you still need is the {team-id}. You will get it as an output of the "Create team".
But wait there is a user-id in the copied body. Fill it with your own UPN or submit one in the input parameters via the Power App:
That's nearly it! But guess what. One thing is still not possible.
One aspect is still missing: How do I add users to the newly created channel? Implement this call.
In my case, the flow receives an array with userPrincipalNames from the Power App. So I use a Select-action to transform it in the right formatting. Only downside? You can't submit an array of users. So an Apply-to-Each action it is:
And now the annoying part. I've implemented it right, but...
... Microsoft still wants us to pay for a Premium license :-)
Summary
The action is a nice step forward, but there are still a lot of scenarios not possible with the limited amount of permissions. Let's see, if Microsoft will change that and adds "ChannelMember" permissions. I will try to play around with the action and discover the limitiations. Next step: Adding tabs.