“I’m using Power Automate to create Teams and folder structure in that team, but it keeps telling me that the SharePoint address doesn’t exist!”
Every time you create a new team in Teams, you create also a new SharePoint site. That’s where all the files are being stored – in the good, old SharePoint. But that also means that if you want to create a folder structure in the new team, you create the folders on that SP site. Which is quite easy as Power Automate has actions to do that, all you need is the SharePoint site address. An address that can be different from the team name…
Why is there a difference?
When you create a new team, all you have is the team name. And since there’s no limitation for any special characters, you can get very creative with the team name. But it’s a bit different with the underlying SharePoint site url. The url is very strict about the allowed characters and it’ll ignore the invalid ones.
Taken to the extreme, the SP site url can have nothing in common with the team name.
How to get the SharePoint address?
Since you can’t use the team name, you’ll have to look elsewhere, more specifically in the M365 groups.
Each team doesn’t have only its own SharePoint site, it has also a dedicated Microsoft 365 group. And such group combines the two pieces of information you need – name and email. As with the team name, there’s no limitation on the group name, but as with the SharePoint site url, there’s a limitation on the characters in the email. To put it more directly, the group name = team name, the group email = the SP site url.
After you create the team, list all your owned groups – you created the team, you’ll be one of the owners…
…add ‘Filter array’ to search for a group with the team name…
…and take the ‘Nickname’ output. Don’t worry about the ‘Apply to each’, if the team name is unique it’ll return just one entry. You can also add a ‘Delay’ action before listing the groups to make sure there’s enough time to create everything.
As with SharePoint internal name, there can be a difference between a Teams team name and the underlying SP site address, which can be a problem in a Power Automate flow. In such situations you always need some connector between the values – this time the related Microsoft 365 group. The group has the same name as the team, and the same nickname as the SharePoint site. Add the tenant url to the nickname and you’ll have the SP site url.