Some cases we don’t want to provide SharePoint admin access, or we want to automate the process as a bulk site creation, this will be help full.
Step:1 Created a SharePoint list with columns as per
the below.
Once list is created,
we can see the New Form, we have added the description of the columns to understand
more why we need to add this data, make sure all columns are required
to avoid issues.
Step: 2
For creating a new site, we are using Send a Http request action.
URi: /_api/SPSiteManager/create
{
"request": {
"Title":
"@{triggerOutputs()?['body/Title']}",
"Url":
"https://pwtq.sharepoint.com/sites/@{triggerOutputs()?['body/SiteName']}",
"Lcid":
@{triggerOutputs()?['body/Sitelanguage/Value']},
"ShareByEmailEnabled":
@{triggerOutputs()?['body/EnableExternalSharing/Value']},
"Description":
"@{triggerOutputs()?['body/Description']}",
"WebTemplate":
"@{triggerOutputs()?['body/SiteTemplate/Value']}",
"Owner":
"@{triggerOutputs()?['body/SiteOwner/Email']}"
}
}
I have created a couple of items to create a SharePoint site.
Flow was started and site was provisioned successfully as per
the below.
We can also update the site URL in the SharePoint list using
update action for future reference.
0 - Not Found. The site doesn't exist.
1 - Provisioning. The site is currently being provisioned.
2 - Ready. The site has been created.
3 - Error. An error occurred while provisioning the site.
4 - Site with requested URL already exist.