“I need to create the same SharePoint page on multiple sites, can I use Power Automate to create a copy when SharePoint doesn’t let me do it?”
The modern SharePoint interface allows you to very easily move or copy files. You select one or more files, and the ribbon/context menu gives you the ‘Copy to’ and ‘Move to’ options. It works in all the libraries, with one exception – the ‘Site Pages’ library. It’s not possible to move pages using the interface, and it’s possible to copy them only within the library. If you want to copy/move a page between sites, you must use a different approach.
Copy the page with Power Automate
And the approach can be to use a Power Automate flow. Even though the interface doesn’t allow it, ‘Site Pages’ is still a document library and pages are documents. And as such, the pages can be copied or moved similar to any other file. But to do that, you’ll need the ‘Site Pages’ library ID.
Get the ‘Site Pages’ library ID
If you use any of the ‘… file’ actions, you won’t see the ‘Site Pages’ among the dropdown values. But even if it’s not there, it can still be accessed using the library ID as a custom value.
Build the flow
Once you have the library ID, you can build the flow. Use the ‘For a selected file’ trigger and add a text input ‘Target site’.
Follow with the ‘Get file properties’ action to turn the page ID into page identifier. You’ll need the ‘Site Pages’ library ID once more for this action.
Then just copy or move the file using the identifier. Since the ‘Site Pages’ library has always the same path (if you use the same SharePoint language), you can hard code the ‘Destination Folder’ to /SitePages.
Once you save the flow, it’ll be available under the ‘Automate’ menu. Start the flow, enter the url of the other site, and copy/move the page.
Summary
Even if SharePoint doesn’t allow you to copy or move a page, Power Automate can do it. The only complicated part is to get the ‘Site Pages’ library ID, but once you have it, it’s a simple flow with three actions.
Dear Tom
Thanks for this very helpful post!
Any idea how to create a new news page in site pages per flow?
Please also elaborate on the role the promoted status plays.
I tried an http request but didn’t get a valid request.
Thanks so much for your ideas.
Keep it up!
Hello Raphael,
I never did, but if it doesn’t work then I’d try creating one empty news page as a “template” and then use a flow to create a copy of this page.
Hey Tom,
I am getting the below error:
Error – “The query cannot be completed because the number of lookup columns it contains exceeds the lookup column threshold enforced by the administrator – even with view that has 2 columns”
Please help me with a solution.. I have been trying this from a long but getting same error every time
Hi Tom
Just wondering if this process would copy web pages from one Microsoft Team SharePoint Site to another ?
Hello Frank,
it should work as Teams sites are just SharePoint sites on the background.
thanks for this helpful article!
I struggled to get the ‘site pages’ library ID until I tried the following:
Go to settings/site content/site pages and navigate to the site page you would like to copy. Right click Automate – power automate – create a flow.
You will be directed to Power automate platform , select the start trigger “For a selected file”.
Now you can see the sharepoint.list ID in the address bar.
I hope this makes the process even clearer 🙂
That worked great, TLM!
Thank you, it worked!
Hi Tom. Excellent site and brilliant article, thank you.
Everything works as you describe, however I am hoping to use the flow to copy pages to a site in another Microsoft 365 tenancy.
the first problem I ran into is the flow step to copy the file can only authenticate with one connection, yet it needs to perform an action on the source and target sites… i got around that by sharing the target site with my account in the source site domain.
But, now the flow keeps throwing the following error (see below) I’ve manually checked the URLs in the raw input and output steps in the flow and they are all correct and look identical in structure/syntax to the input/output when copying the site page between two sites in the same tenancy. any help would be greatly appreciated 🙂
Invalid URL: https://xxxx.sharepoint.com/sites/zDev_dd_Teams_20201114/SitePages.
clientRequestId: 150f05fb-bf96-4b89-af76-549e3e64b0d7
serviceRequestId: 150f05fb-bf96-4b89-af76-549e3e64b0d7
Hello David,
I’m afraid you can’t use the solution between different tenants. You could maybe save the pages files and then move them to the other tenant, but Power Automate won’t let you connect to two tenants at the same time. Unless you use HTTP requests but that’s a different topic…
Thanks for this! I sometimes want to MOVE .aspx files into a different subfolder in the same site. You can’t do that OoB in either Modern or Classic SharePoint anymore (grrrr) … and COPY strips the version history, which I want to preserve. I followed your flow, just creating a “Move file” action instead of a “Copy file” action. I’ve never used Power Automate before, so it took a little doing to find all the correct options and variables to replicate your flow … but I had it working within about 15 minutes!