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
abm
Most Valuable Professional
Most Valuable Professional

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

19 REPLIES 19
abm
Most Valuable Professional
Most Valuable Professional

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. 

abm
Most Valuable Professional
Most Valuable Professional

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? 

abm
Most Valuable Professional
Most Valuable Professional

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. 

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
Skilled Sharer
Skilled Sharer

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. EDIT: you can query the Graph API without a premium plan as abm points out below. So, skip the rest of this post and look at the messages after this one 🙂

 

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 😉

abm
Most Valuable Professional
Most Valuable Professional

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

abm
Most Valuable Professional
Most Valuable Professional

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
Anonymous
Not applicable

Reviving an old thread again since this was so close to answering what I need. This worked and I can see the webURL in the body....but how do I use that in my following steps? What I want to do is after the team is created, update a SharePoint list field to hyperlink to the new document library for the Team.

BridgetZ_0-1665764875274.png

 

Hi @Anonymous 

 

You would just use the following expression to reference the retrieved value:

 

body('Send_an_HTTP_request')['webUrl']

 

EDIT: just to clarify, the above expression basically says: "give me the 'webUrl' property of the output body of the 'Send_an_HTTP_request' action".

 

OliverR82_0-1665769089208.png

 

Once you know how to interpret the outputs of actions, it's easier to get to the values you want, even if they don't show up for you in the list of dynamic contents. Note that you have to replace any spaces in your action names with underscores if you reference them in an expression. That's why it's usually also a good practice to consistently rename your actions to a more descriptive (and shorter) name. That will also make it easier to understand what your flow does when you revisit it in a couple of months.

 

In your example, "Get webUrl" would be a more fitting name, and thus your expression to reference the returned value would become:

 

body('Get_webUrl')['webUrl']

 

Hope this helps!

omelo
Helper II
Helper II

Hi @OliverR-82 ,  I need some help if you don't mind!
 I'm following your response (after a few days searching 😊) to use the HTTP request action to get the url of the newly created team to be able to create a folder structure.
The first part of my flow works but when I get to the HTTP part, I'm getting "Resource is not found"

Screenshots of my flow are attached.

Do you have any suggestions to get this fixed.

Thank you for your help.

 

Hi @omelo 

In your 'Create new folder' action you put the dynamic content 'Body' in the 'Site address' field. However, that will input the entire body that is returned by the HTTP request. You need just the webUrl property.

 

Put the following expression in the Site Address field:

 

body('Send_an_HTTP_request')['webUrl']

 

That should fix your problem. Let me know if that helps!

 

EDIT: btw, the answer to your question was actually already in the message right above yours 🙂

Hi @abm Is this still working for you? Oddly, when I put that query into Graph Explorer it gives me the output I want, but when I try and use the Send an HTTP Request it errors. I'm wondering if it could be something to do with permissions?

abm
Most Valuable Professional
Most Valuable Professional

Hi @EdWG 

 

What error are you getting? Could you please post a screenshot?

 

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

Oh, that's a great solution! I struggled with trying to get the webUrl for hours. Other solutions suggest using Send an HTTP Request to Graph, but it seems that doesn't work any longer because of different security requirements. The response is InvalidAuthenticationToken. No such problem with this Send an HTTP Request to SharePoint action.
Tom

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages