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
Dual Super User
Dual 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.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (3,060)