Quick Bits: How to get the SharePoint URL for a Microsoft Team in Power Automate
Working with a customer recently, we were trying to figure out how to use Power Automate to create a Microsoft Team and then capture the SharePoint URL for that Team so we could create some custom lists in that SharePoint site.
Here’s how we did it…
TLDR — we use the HTTP with Azure AD action to call the Microsoft Graph API’s Groups endpoint, passing in the ID of the Microsoft Team created using the Create a Team action. The JSON response contains a reference to that SharePoint site URL.
We use the Groups endpoint because the SharePoint site is tied to the Microsoft 365 Group, not the Team entity, and the Team entity does not actually include a reference to that URL.
We parse the JSON response using the Parse JSON action and it outputs the web URL of the underlying SharePoint site as an output property.
That’s it. Now you can do whatever you need to do with that URL.
Side note: We initially planned to use the Send an HTTP request to SharePoint action because it allows us to make API calls to SharePoint without a premium Power Automate license. However, the HTTP with Azure AD action does require a premium license so I would probably revise this Flow to use the HTTP with Azure AD action and call the Microsoft Graph lists endpoint rather than using the SharePoint REST API.