Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Introduction

In this article, we will learn to create multiple copies of a SharePoint site page, rename and update its properties using Power Automate.

Use case: I had a requirement to create multiple pages with similar layout, and properties. I have implemented this requirement using Power Automate and an Excel sheet table for list of page title and page name.

In this demo, we will use the table below and the site page highlighted in the screenshot to create copies of the site pages.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate
Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Below are the steps to create a PowerAutomate flow for creating multiple copies of a SharePoint site page,

Step 1

Create a new instant cloud flow with the "For a selected file" trigger.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Step 2

Navigate to Site Pages library settings to find the library ID and configure the flow trigger action.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Click on “Enter custom value” and enter library id.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Step 3

Add "Get file properties" action and configure it using ID value from the previous step.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Step 4

Next, add the "List rows present in a table" action to get a list of page titles and names from the PagesTable of the sheet.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Step 5

Add "Apply to each" action to loop through list of table rows using value from the previous step.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Step 6

Add the "Copy file" action and configure as per below screenshot to create copy of the selected site page. You need to use Identifier property of the source page.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Step 7

Add the "Get file properties" action to get newly created site page in last step.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Step 8

Add the "Send an HTTP request to SharePoint" action to update page title and page name for current table row. Provide request body properties to update, we have used "FileLeafRef" property to rename SharePoint site page.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Step 9

Select a page and run the flow to create copies of the selected SharePoint page.

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Output

Flow created 5 copies of the selected page(DemoPage) and renamed and updated the title in accordance with the Excel sheet table. 

Create Multiple Copies Of A Site Page, Rename And Update Properties Using Power Automate

Conclusion

In this article, we learned to create multiple copies of a SharePoint page and rename it using SharePoint API request in Power Automate. You must use SharePoint API call to rename SharePoint page with 'FileLeafRef' property.

Thank you for reading.


Similar Articles