Add Image Gallery Web Part on page

How to add an Image Gallery web part on a SharePoint Online page in a Power Automate flow.

This sample adds the web part to a One Column section on the page. The web part dynamically displays 5 images from a document library in the Carousel layout.

URI

Headers

Body

Screenshot with example

Below are a bit more details about the values used in this example. Hopefully that helps in configuring the right body payload.

PropertyValueDetails
images[]Collection of images you want to use, in case imageSourceType is set to 1
imageSourceType2Selected Images (1) or Dynamically display images from a document library (2)
layoutoneColumnOne Column Section layout, other Layout value options
layout1Layout type for Image Gallery, in this case Carousel. See other options at the bottom of this page
listIdd8ed3432-5da5-4c51-b2b9-f0ca0ef5fca7Guid of the Document Library used
listUrl/sites/PowerUsers/Conference PhotosRelative Path of the Document Library used
maxImagesCount5Amount of Images used in the Carousel
searchablePlainTextsDunder Mifflin ScrantonLabels as key/value pair for the Web Part Title
SitePageIdea2a068c-6c02-424c-8019-2dc770d37851Guid of the Page which will be updated
SiteIdcontoso.sharepoint.com,0b11c57d-ef88-46d7-9743-8e800c507595,af1a15c6-956b-4652-b8f8-869836e4e6eeEnvironment Variable used in the Site Address
WebPartTypeaf8be689-990e-492a-81f7-ba3e4cd3ed9caka Image Gallery, other supported Web Part types
addimagegallerywebpartonpage_setup

Expected response

Will return the details of the updated page.

Copy/paste example

Resources

Update sitePage
supported Web Part types

LayoutDisplay Name
1Carousel
2Grid
4Brick
That’s it, Happy testing!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.