web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Automated Teams Site C...
Power Automate
Answered

Automated Teams Site Creation with Template

(0) ShareShare
ReportReport
Posted on by 131

Been wrapping my head around this for several months, hoping someone in the community has a possible solution.

I have a flow that automates Teams creation. But I have to manually go in each time the team is created and modify the homepage of that team's sharepoint site to have the proper layout and web parts. Is there a way to automate this? I simply want every new teams site created via the flow to them apply the same layout and web parts. 

 

I want every new site to look like this. The theme colors come from the hub it automatically gets associated with.

theme.jpg

Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,871 Most Valuable Professional on at

    Hi @Kamz,

     

    There are several options you would have to achieve this.

     

    A. You could either a couple of Send an HTTP request to SharePoint actions and use a POST request with the SavePage method and reuse the body json of this example page.

     

    B. Another option could be to trigger a PnP PowerShell script via a flow. That script can be hosted in either a Azure Function or Runbook and could use the Invoke-PnPSiteTemplate cmdlet which would use an asset with your configuration. This would be an export of your page (an xml or pnp file)

    https://learn.microsoft.com/en-us/sharepoint/dev/solution-guidance/introducing-the-pnp-provisioning-engine

     

     

  • Kamz Profile Picture
    131 on at

    Thanks for the input, do you have a article on how to do A? B I'm familiar with but don't have Azure admin access.

     

    This is the current flow ideally I'd put it after join to HUB

    FLOWTeams.jpg

  • Verified answer
    Expiscornovus Profile Picture
    33,871 Most Valuable Professional on at

    Hi @Kamz,

     

    The general approach could be something like below.

     

    1. Create a Page

    POST
    _api/sitepages/pages

     

    2. Checkout a Page

    POST
    _api/sitepages/pages(@{outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['d']['Id']})/checkoutpage

     

    3. SavePage or SavePageAsDraft with body which contains all the components in the CanvasContent1 property

    POST
    _api/sitepages/pages(@{outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['d']['Id']})/SavePageAsDraft

     

    4. Publish your page

     

    POST
    _api/sitepages/pages(@{outputs('Send_an_HTTP_request_to_SharePoint')?['body']?['d']['Id']})/publish

     

    savepageasdraft_method.png

     

    The SavePageAsDraft request would look like below.

     

    What makes it a bit more complex is figuring out which json to use in the CanvasContent1 property and more specifically retrieve all these values dynamically.

     

    For example with the Document Library webpart you would have to retrieve the related siteid, related webid and the listid of the document library which just has been created which you want to use in the first section of your page.

     

    canvascontent1.png

     

    Hope this helps to get you started?

  • Kamz Profile Picture
    131 on at

    This turned out to be great. What I ended up doing to get the links and people web part was viewed the page source of the "template site" and copied that canvas content and changed the GUID and variable info of the submitter to auto fill it out. Thank you so much

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 411

#2
David_MA Profile Picture

David_MA 300 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 291

Last 30 days Overall leaderboard