Adding a photo library programmatically
One of our clients came to us with a request for creating a SharePoint site automatically based on a project management list. If a project was set to "Start", then a SharePoint site would be created. That will be covered in another article, but one of the interesting asks was to automatically include a photo library that would also be displayed in the QuickLaunch Navigation.
I referenced this article for the API syntax: http://www.ludovicperrichon.com/sharepoint-rest-api-call-with-powerautomate/#createlink
- Create your flow however you like, a simple way to set this up is to create an instant flow and use the button trigger with a single input for the SiteURL.
- Create a "Send HTTP request to SharePoint" step.
- Site address: SiteURL
- Method: POST
- URI: _api/web/lists
- Headers:
- Accept | application/json;odata=verbose
- Content-Type | application/json;odata=verbose
- Body:
- Add another "HTTP to SharePoint" step
- Site address: SiteURL
- Method: POST
- URI: _api/web/Navigation/QuickLaunch
- Headers:
- Accept | application/json;odata=verbose
- Content-Type | application/json;odata=verbose
- Body:
{
"__metadata":{
"type": "SP.List"
},
"AllowContentTypes": true,
"BaseTemplate": 109,
"ContentTypesEnabled": false,
"Description": "Photo library for __________",
"Title": "Photos"
}
{
"__metadata": { "type": "SP.NavigationNode"},
"IsExternal": false,
"Title": "Photos",
"Url": "SITEURL/photos"
}