Share via

Dynamically displaying document libraries

Anonymous
2024-06-18T13:44:15+00:00

Deep breath...

I have a SharePoint site that is used to manage various developments within our organisation. Each project has a dedicated page and a dedicated document library. For simplicity, the page title and document library name are the same. To ensure a degree of consistency in the structure of each page, I have created a page template that is used for all pages. The document library is created using power automate and always has a number of sub-folders:

\Documentation

\Installers

\Resources

\User Guides

All fine, all working.

What I want to do now is to update the page template so that it uses Highlighted Content web-parts to display the contents of these sub-folders. However because each page has its own document library these HCWP would need to be updated each time a page was created from the template. Given that the page title and document library as named the same, I'm sure that there must be a way to do this dynamically (using KQL??)

I've got as far as this:

DocumentLink:"https://XXXX.sharepoint.com/sites/YYYY/EXPOS/Documentation/" AND FileType:

And it works but it is not dynamic. I need something like this:

DocumentLink:"https://XXXX.sharepoint.com/sites/YYYY/{Page.Title}/Documentation/*" AND FileType:*

Can anyone help me please.

Many thanks in advance

Microsoft 365 and Office | SharePoint | For education | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2024-09-16T11:40:03+00:00

    Hay VM.

    Yes & No. No, you dont seem to be able to do this using any OBF in SharePoint. Yes I managed to do it my modifying the page via Power Automate.

    HTH

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2024-09-13T19:46:54+00:00

    I'm looking for same scenario. Did you find an answer for it? If so, could you please share?

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2024-06-18T16:03:07+00:00

    Hi Tin

    Thanks for your reply. I think you are missing what I'm trying to achieve. I'm not trying to change the address of a document library. What I'm trying to do is to dynamically change where a HCWP is looking for the documents it displays.

    Any thoughts

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2024-06-18T15:53:56+00:00

    Dear Mike Collins6

    Good day! Thank you for posting to Microsoft Community. I am happy to help you

    Based on my research, SharePoint doesn't have a built-in feature to change the URL of a document library, but it seems that the URL can be changed through SharePoint Designer:

    Is it possible to change the web address of a document library in SharePoint? - Microsoft Q&A

    If you'd like to learn more about SharePoint Designer, you can post to this forum: Questions - Microsoft Q&A  I am sure that our experts from that team can address your query effectively and accurately.  

    Thanks for your cooperation.

    Sincerely,

    Tin | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments