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?
Solved! Go to Solution.
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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi @Anonymous
Could you please post a screenshot of your flow?
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogSure
First I create a team based on the response to a form
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.
Sure, First step is to gather response from a forum and create a team based on it.
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.
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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogok, 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
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogPerfect, 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.
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.
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:
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.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi @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
Hi @OliverR-82
Its comes under O365 hence its under that action list. Thanks for your update.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThe first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
30 | |
29 | |
27 | |
20 | |
11 |