Using Power Automate to Create a Photo Library and Add it to the Navigation

April 01, 2023 10:07 PM Comment(s) By Ryley Bauer

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

  1. 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. 
  2. Create a "Send HTTP request to SharePoint" step. 
    1. Site address: SiteURL
    2. Method: POST
    3. URI: _api/web/lists
    4. Headers:   
      1. Accept | application/json;odata=verbose
      2. Content-Type | application/json;odata=verbose
    5. Body: 
    6. {

      "__metadata":{

      "type": "SP.List"

      },

      "AllowContentTypes": true,

      "BaseTemplate": 109,

      "ContentTypesEnabled": false,

      "Description": "Photo library for __________",

      "Title": "Photos"

      }

  3. Add another "HTTP to SharePoint" step
    1. Site address: SiteURL
    2. Method: POST
    3. URI: _api/web/Navigation/QuickLaunch
    4. Headers:   
      1. Accept | application/json;odata=verbose
      2. Content-Type | application/json;odata=verbose
    5. Body: 
    6. {

      "__metadata": { "type": "SP.NavigationNode"},

      "IsExternal": false,

      "Title": "Photos",

      "Url": "SITEURL/photos"
      }


Ryley Bauer

Share -