In SharePoint O365 online, I need to display a list of documents from across the enterprise that match a term. The results need to be grouped by a property and presentable to site users.

Where I am right now

I'm trying to display a web part to make this available for users on a site page, but if there is a required alternate approach that achieves the result, I would be open to switching rather than accepting it is not possible through a web part. I started with a highlighted content web part which lets me enter KQL to retrieve the results I need.

For the term, I determined that I can identify the documents associated with the term using KQL to define the term set ID matching the defined term which seems to be working: #ParentTermSetIdGUID:"MY TERM TEXT". The problem from there is I cannot group by or apply CAML to the highlighted content web part.

For the grouping: I have mapped the relevant crawled properties and indexes to a managed property AgreementType. In the highlighted content web part, I can sort by this field, but I cannot group by it or even display the value in the results to make it clear when the documents transition from one type to another.

My next thought was somehow to create a view to present enterprise documents using KQL, then format using CAML, but it doesn't seem like such functionality exists in SharePoint online.

Any suggestions are appreciated!

1 Answer 1


This is a known limitation of SharePoint out of the box Highlighted content web part, you cannot group returned results. Also, you cannot add more columns to the view or customize the look and feel of the web part.

You can use PnP modern search web parts for such requirements. PnP Modern Search web parts allow Searching based on terms as well as customizing the display template for returned results.

Check: PnP Modern Search web Parts

  • 1
    Based on this suggestion, I used PnP Modern search web part with custom react component extension and styled with Microsoft fluent-ui components. Commented Aug 4, 2023 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.