Skip to main content
Community site session details

Community site session details

Session Id : FF2Wej20QHmLESitWCpgo9
Power Automate - Building Flows
Unanswered

Cloning a Team using Graph, Folder bugs.

Like (0) ShareShare
ReportReport
Posted on 12 Mar 2024 16:13:34 by

Hi all,

I've noticed an increase in demand for automated team creations based off custom templates. 

 

The workflow is pretty straight forward.

Form is submitted -> Flow is triggered -> Existing Team is cloned -> Value's are changed based on pre-defined values in the form.

 

The template team site consists of some basic unconfigured apps, Tabs & 3 channels(including general) with a bland folder structure.

Everything is set public (for the time being). 

 

Authentication:

Azure Enterprise application with the following API Permissions:

 

 

 

 

 

Directory.ReadWrite.All
Group.ReadWrite.All
Team.Create
Teamwork.Migrate.All
User.Read

 

 

 

 

 

 

HTTP Request:

 

 

 

 

 

{
 "type": "Http",
 "inputs": {
 "uri": "https://graph.microsoft.com/v1.0/teams/@{variables('TemplateSite')}/clone",
 "method": "POST",
 "body": {
 "displayName": "Project-@{variables('NewTeamName')}",
 "description": "The new site for Project-@{variables('NewTeamName')}",
 "mailNickname": "Project-@{variables('NewTeamName')}",
 "partsToClone": "apps,tabs,settings,channels,members",
 "visibility": "Public"
 },
 "authentication": {
 "type": "ActiveDirectoryOAuth",
 "authority": "",
 "tenant": "@{variables('TenantId')}",
 "audience": "https://graph.microsoft.com",
 "ClientId": "@{variables('ClientId')}",
 "secret": "@{variables('ClientSecret')}"
 }
 },
 "runAfter": {
 "ClientSecret": [
 "Succeeded"
 ],
 "NewTeamName": [
 "Succeeded"
 ],
 "TemplateSite": [
 "Succeeded"
 ]
 }
}

 

 

 

 

 

 

Results:

Within 60 seconds of submitting the form i see a new team has been created and applications/tabs get linked.

 

Issue:

If i browse the team in SharePoint and click Documents the following becomes clear:

raouljaptjong_0-1710256432629.png

The error for every folder as listed above is: 

"There was an error retrieving this channel's SharePoint URL."
 
Using the "get channel email"  work around yields 0 results as it responds with:
We couldn’t get the email address of this channel.
Please try again later.
 
Weirdly enough it does generate a general folder under "in site library" but this isn't linked with the Channel itself.
 
Lastly if i create a new channel a folder corresponding with the channel name is made and seems to be fully functional.
Liquid error: Exception has been thrown by the target of an invocation.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete