cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Find sharepoint URL for created team

Hello

 

I'm trying to automate a process we have and part of that process is to create a team and copy up to date copies of various version controlled documents. 

 

Once I've created the team I have the team ID in dynamic content but I need to use the sharepoint actions to copy files into the team, how can I find the sharepoint URL dynamically? 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Anonymous 

 

Thanks for your reply.  Yes if you have any spaces in your team name it automatically removes the spaces when it creates the SP site. I did tested this. One thing I found out is there is a delay in creating SP sites so you might having some issues if you immediately access the Team SP site url. Try it and see.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

12 REPLIES 12
abm
Super User
Super User

Hi @Anonymous 

 

Could you please post a screenshot of your flow?

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
Anonymous
Not applicable

Sure

 

First I create a team based on the response to a form

 

Create a team 

 

then I want to create a folder structure and copy various controlled document templates into the team/sharepoint storage but I don't know the sharepoint site address.

 

Create folder 

Anonymous
Not applicable

Sure, First step is to gather response from a forum and create a team based on it.

create-a-team-flow.png

 

Then start to create folder structure and copy files into the team but I don't know how to find the sharepoint site address dynamically in order to do so.

sharepoint-flow.png

 

I've got a few more steps after that but this is the part that has got me stumped. 

Hi @Anonymous 

 

You won't be able to get the SP URL dynamically. You need to hardcode the URL in below format. You could dynamically map the team name from the create team step.

 

YourSPURL/sites/yourTeamName

 

Thanks

 

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
Anonymous
Not applicable

ok, I should be able to work with that. Is it as simple as saying team name without any spaces? 

Hi @Anonymous 

 

Thanks for your reply.  Yes if you have any spaces in your team name it automatically removes the spaces when it creates the SP site. I did tested this. One thing I found out is there is a delay in creating SP sites so you might having some issues if you immediately access the Team SP site url. Try it and see.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
Anonymous
Not applicable

Perfect, Thanks!

 

Share point actions won't be time critical so i'll stick a delay in there just to be safe. worse thing would be if it worked fine now but didn't when I tried to use it for real. 

caroblahblah
New Member

Hey all, 

 

Any advice on dealing with a Team whose name includes a special character? Do I assume that the character is skipped along with any spaces? An example would be: 

 

"Test New Job - 4/3/2021 12:59"

 

My scenario involves making a Team based on an email submission for a new job. Unfortunately both spaces or special characters could be in play for these names. I would rather use some kind of GUID to identify the SharePoint site that gets created during the Team creation, but that doesn't seem to be possible. The following steps in my Flow involve creating folders in the newly created SharePoint. 

 

Any additional thoughts would be appreciated. 

OliverR-82
Helper V
Helper V

I'm sorry to revive a somewhat old thread but this seems to be a topic that many people are looking to find answers on, and none of the answers posted in this thread are adequate, IMO. I needed to do this myself for a project a little while ago, and I thought I would share my findings here, hopefully it will benefit some people.

 

The main problem is that the 'Create a team' action in Power Automate does not return a SharePoint URL. It does, however, return a Team ID, which can be used to look up the SharePoint URL.

 

There are a number of ways to do this. The most obvious way and the one most often referred to or described online, involves using the Graph API. The URI you would call using the Graph API would be the following:

 

https://graph.microsoft.com/v1.0/groups/<your new team ID>/sites/root?$select=webUrl

 

The Graph connector is a Premium connector, though, and as such not an option for many people who are restricted to use only standard connectors.

 

You can also query the Graph API with the HTTP action (not the SharePoint HTTP action, the regular HTTP action), too, but that's also a Premium connector. However, it's interesting to note that the HTTP action is not a Premium connector in Azure Logic Apps, which is what Power Automate is built on, pretty much. The UI is largely the same, so if you have access to use Azure Logic Apps then that may be a viable alternative.

 

However, - and this will be the most useful part for most people here - there seems to be one other way to get the SharePoint URL from a Team ID (ie. Group ID) using the SharePoint HTTP action. I just came across this in one of my own flows, so it must be something that I built using info that I found online, but unfortunately I can't find the original source; I only have the action in my flow, and this is what it looks like:

OliverR82_0-1635060360942.png

  • Site address: any SharePoint site that you (or the user / account running the flow) has access to, it doesn't really matter which site it is so long as they have access to it.
  • Method: GET
  • URI: 
    _api/search/query?querytext='contentclass:sts_site groupid:<your new team id>'&selectproperties='Title,Path'&Properties='EnableDynamicGroups:true'
  • Headers: Accept - application/xml (this is important, usually you use json here but in this case we want to get back XML.

This will return output in XML format. To get the SharePoint URL out of there, you need to use the following expression:

 

first(xpath(body('SearchSP'),'//*[local-name()="element"][*[local-name()="Key"]="Path"]/*[local-name()="Value"]/text()'))

 

Be sure to replace the 'SearchSP' in the above code with whatever name you have given your HTTP action; in this example, I renamed my HTTP action 'SearchSP' so that's what I put in the expression. If you have any spaces in your action name, replace them with underscores in the expression.

 

It's a good idea to put the above expression in a Compose action, that way it will be available for you to use from the Dynamic content list.

 

Voila, that should return the SharePoint URL.

 

I hope this is useful information for someone. If it is, be kind and give it a thumbs up 😉

Hi @OliverR-82 

 

Thanks for the reply. Just to let you know that there is a new Send an HTTP graph connector which is not premium anymore.

 

image.png



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hi @abm ,

 

Thanks for pointing that out, I was not aware of that. It's a bit confusing to me that that action is listed under the O365 Groups connector, so it doesn't show up when you search for "Graph".

 

That makes the answer to this to this thread a lot easier, then. Just use that action and use the URI that I mentioned previously:

https://graph.microsoft.com/v1.0/groups/<ID of your team here>/sites/root?$select=webUrl

OliverR82_0-1635145967201.png

Hi @OliverR-82 

 

Its comes under O365 hence its under that action list. Thanks for your update.

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,388)