Share Button

How to copy a Site Page to any site within your Tenant

I have created a Help page with the new collapsible sections option. It is a page that I can use in other sites as well. Having said that I have more pages that I can re-use when developing a new site. I.e.

  • SiteManagement
  • Help
  • How to create a flow

For this reason I have issued an item in the Techcommunity to create an option to copy pages from one site to another inside or outside your tenant. Please vote on it with this link. Make Modern pages available throughout 1 or multiple tenants – Microsoft Tech Community In the meantime we had to move on and so we created a solution to copy pages within a tenant.

Steps to enable copy pages from 1 site to new or existing sites?

  1. We created a template site (team site without groups)
  2. We have stored all the pages that we want to re-use in the Site Pages list on this site. I.e. System management, help pages etc.
  3. We have added a column named Copy
  4. We created a flow to copy a page from OrganizationTemplates site to the new site that we want to create
  5. We have formatted this column to show a button that enables to copy the page.

Preparations before creating the Flow

Create a template for the OrganizationTemplates Site

Create a team site without a group called OrganizationTemplate

Store template pages in the Site Pages library

We have stored all the pages that we want to re-use in the Site Pages list on this site. I.e. System management, help pages etc.

Create a column named Copy

This column will contain the buttons to copy pages from OrganizationTemplates site to other sites in the Tenant

Steps to create the "copy" flow

Create the copy workflow

Go to Power Automate and then create (flows)

Step 1

Step 2

Step 3

Select the trigger type

Select the source

Define the target site

Choose the operation you want to perform

Note: As the source remains you have to change the target site name to the site you want to copy to. I.e it can be something like https://yourtenant.sharepoint/sites/NewSite

This the complete flow

Format the Copy column in the Site Pages library

When you have saved the url shows in the last part the identifier code needed to copy into the Json code. Use the advanced mode to achieve this Remove the default code and replace it by the Json below

JSon code

{ “$schema”: “https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json”, “elmType”: “button”, “txtContent”: “Copy Page to Another Site”, “customRowAction”: { “action”: “executeFlow”, “actionParams”: “{\”id\”: \”5ee4b977-3787-4411-ae01-f17795a689db\”}” }, “style”: { “background-color”: “#8daca6”, “color”: “#ffffff”, “outline”: “transparent”, “border-width”: “1px”, “border-style”: “solid”, “border-radius”: “5px 25px”, “border-color”: “transparent”, “cursor”: “pointer”, “font-size”: “12px” } }

Pages will show including the buttons

Thanks to a post of Gregory Zelfond I added the Page Type as a column to the sitepages.

Code 0 = SharePoint Page, Code 1 = Publication page unpublished, Code 2 = Published page Published

Synopsis

You only have to change the target site in the flow as described above. Then you can immediately use the button to copy any page to the target site.

When you want to copy modern pages to the OrganizationTemplates site. You can use the same method

Note: Source and target need to be changed. And the Flow must be copied and thereafter the code of the new flow has to be copied into the Json Code.

Do you want to see where we have used this technique in all our solutions? FinancialSuite® software – Office365 solutions

(283)

Share Button

Related Blogs

No Image