Page Template System using Power Automate
  1. Introduction and Video
  2. Workflow Blocks

1. Introduction and Video


This guide explains how to create a Power Automate workflow which can deploy page templates to any SharePoint site.

It is required to follow steps by watching the video before building your Flow using the screenshots below.

You will be creating a workflow that can be reused any time you want to deploy a page template to any site in SharePoint.

Required for this training

  • Basic Experience using Power Automate
  • SharePoint Admin permissions

The flow button comes from the free Flow Button template.

The tile image preview comes from the Image Shadow Box template.


2. Workflow Blocks

Get the GUID of the Site Pages library by going to the library settings screen and copying the code from the URL as shown:





The above flow action is the Copy file action.

The below flow actions are the Send an HTTP Request to Sharepoint actions.


Code snippets:

_api/web/lists/getbytitle('Site Pages')/items(SELECT "ITEMID" FROM DYNAMIC CONTENT)
content-type application/json;odata=verbose
IF-MATCH *
X-HTTP-Method PATCH
{'__metadata':
{'type':'SP.Data.SitePagesItem'},
'Title':'SELECT "PAGE TITLE" FROM DYNAMIC CONTENT',
'FileLeafRef':'SELECT "PAGE NAME" FROM DYNAMIC CONTENT'
}

_api/sitepages/pages('SELECT "ITEMID" FROM DYNAMIC CONTENT')/publish


Code snippets:

/_api/web/rootfolder
Accept application/json;odata=verbose
Content-Type application/json;odata=verbose
X-HTTP-Method PATCH
IF-MATCH *
X-RequestDigest xRequestDigest
{'__metadata': {'type': 'SP.Folder'},'WelcomePage': 'SitePages/SELECT "PAGE NAME" FROM DYNAMIC CONTENT.aspx'}