Copy site page with quick links to another site

Occasional Contributor

Hi

 

I have created a Power Automate flow that allows users to automate the creation of SharePoint sites.  They enter the site name and this creates the site using REST and then also copies some content from a template site.  The content that is copied is some folders and files from the Shared Documents library and a custom home page.

 

This all works fine - the content gets copied with no issue and the new home page is set as the site home page.  However, this new home page (which is copied from the template site) contains a Quick Links web part, which displays links for the folders in the Shared Documents library.  The issue is that the links in this web part are still pointing to the template site URL.  I was hoping to use relative URLs as these would be the same each time (/Shared Documents/Folder 1 etc) but Quick Links only seems to allow for the full URL:

 

gjayne84_0-1637858405348.png

Is there a way around this as everything else works perfectly in the automated process, but I can't see a way around this issue?

 

Thanks in advance.

3 Replies

Hi @gjayne84,

Did you find a solution / workaround to your question? I have exactly the same issue.

 

Thanks a lot!

@taupia_a 

I did find a solution in the end but it took a few extra steps in the flow.  After the flow creates my new site now I have the following actions below:

 

gjayne84_0-1667908485972.png

 

The varSiteURL holds the name of the newly created site.  The first action above copies the home page from my template site to the new site.  To be honest, it was quite a while ago I did this so looking at it now I'm not sure why I've copied the home page rather than just got the metadata from the existing home page.  It may be that you don't need the home page copy action.

 

The Get file metadata action is used to provide the ItemId dynamic data used in the next step to check out the home page.

 

I then use the action below to edit the home page so I could change the quick links etc:

 

gjayne84_1-1667908822865.png

 

In order to get the above code for the Body I opened the home page of my template site and then opened the dev tools in Crome or Edge.  You then need to edit the page and republish (you don't have to make any changes).  Once you've done this look for SavePage in the Network tab of the dev tools pane:

 

gjayne84_2-1667909428015.png

 

Click View Source as circled above and you'll get the code to paste into the flow action.  From there then you just have to work out which bits need to be dynamically set in your flow i.e. quick link URLs etc.

 

I hope this helps but if you need anything else give me a shout.

Hi @gjayne84,

 

Great explanation, thanks a lot! I will make a try.