Custom query that will fetch managed property value and show pages with similar values in a Hightlighted content WebPart

ChristianDias-SIL 96 Reputation points

I've tagged/categorized all site pages in my SharePoint site and would like to add a highlighted content WebPart with a custom query that is able to check what values are in the managed property and then filter any site pages with those same values.

A site page containing highlighted content WebPart, with the value "Outlook" as one of its managed properties will show all site pages also containing "Outlook" as a value in their managed properties.

Currently, I only have a static way of setting this Query. I've mapped the crawl to a managed property and it works but I would like for it to be able to get the value first and then filter those pages automatically.

The below is the custom query I use.

RefinableString00: Outlook

Any ideas?

Thanks in advance

A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,861 questions
{count} votes

Accepted answer
  1. ChristianDias-SIL 96 Reputation points

    Hi @CaseyYang-MSFT ,

    Thanks for your response.

    I was at an impasse where I could only input the value manually. By value, I meant a static value to search for in the query but what I was looking for was a more automatic approach as I wanted to create a Site Page template.

    I managed to figure out how to do this. Using PnP Modern Search Results WebPart and the following text query, {|RefinableString00:{Page.WikiCategory}}. It identifies the values in a managed property of the current page and queries pages with the same values of that managed property, WikiCategory.

    I created a template Site Page with the WebPart pre-configured so any time a page is created, tagged with a value in the managed property and published it will show automatically all pages that are "related content".

    Christian Dias

1 additional answer

Sort by: Most helpful
  1. CaseyYang-MSFT 10,321 Reputation points

    Hi @ChristianDias-SIL ,

    What do you mean " a static way of setting this Query"?

    Per my research, when you use custom query Hightlighted content WebPart will list all pages that contain "Outlook".

    For Reference:

    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.