cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BR1984
Helper I
Helper I

Create sharepoint site flow - API

Hi 

I have a form where my employ fill when they need to create a sharepoint site with a template we have made - now we do it manually from sharepoint where we chose the template and site name and so on.

 

Can flow with API do this - has anyone tried ? - i know before we could create subsites (old sharepoint) but has never seen with modern sites.

Thanks

1 REPLY 1
Expiscornovus
Super User
Super User

Hi @BR1984,

 

Yes this would be possible via the REST API methods and some Send an HTTP requests to SharePoint actions.

 

1. Add a Send an HTTP request to SharePoint. Use the Create method from SPSiteManager.

 

{
  "request": {
    "Title": "@{variables('SiteTitle')}",
    "Url":"https://contoso.sharepoint.com/sites/@{variables('SiteTitle')}",
    "Lcid": 1033,
    "ShareByEmailEnabled":false,
    "Classification":"Low Business Impact",
    "Description":"Description",
    "WebTemplate":"SITEPAGEPUBLISHING#0",
    "SiteDesignId":"00000000-0000-0000-0000-000000000000",
    "Owner":"dennis@contoso.onmicrosoft.com",
    "WebTemplateExtensionId":"00000000-0000-0000-0000-000000000000"
  }
}

 

createsite.png

 

2. Add another Send an HTTP request to SharePoint action. Use your new site for the site address field. Use the AddSiteDesignTaskToCurrentWeb method in the URI:

 

 

/_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.AddSiteDesignTaskToCurrentWeb

 

 

 

{
 "siteDesignId": "@{variables('SPOSiteDesign')}"
}

 

 

addsitedesign.png

 

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (2,041)