Forum Discussion
How to display multiple lists on 1 list or a view?
chanpion13 Highlighted content web part uses KQL for custom filter queries. So you can use KQL queries to return the list items from specific SharePoint lists or all lists.
To get items from specific lists, you can use query like:
Path:"https://siteUrl/Lists/List1" Path:"https://siteUrl/Lists/List2" Path:"https://siteUrl/Lists/List3" contentclass:STS_ListItem
To get items from all SharePoint lists (& to exclude documents) use query like:
contentclass:STS_ListItem
You can also add additional filters based on managed properties as per your requirements. Also, check below documentation related to KQL:
Keyword Query Language (KQL) syntax reference
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- jeromedewaeleSep 26, 2023Copper Contributor
ganeshsanap This works using the "path" function for me but how can you choose the columns to display in the view? So far I have this syntax:
path: "https://mysite/sites/site/Lists/Table1"
path: "https://mysite/sites/site/Lists/Table2"
contentclass:STS_ListItem)This returns the Title, Modified and Modified by column of both tables but what if I want to show the Due date column which is present in both lists?
Many thanks!- ganeshsanapSep 27, 2023MVP
jeromedewaele Unfortunately, it is not possible as currently there is no option available to customize the columns shown in Highlighted Content web part in SharePoint.
Check:
- Customize search results returned by Highlighted content web part
- Control columns inside highlighted content
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.
- jeromedewaeleSep 27, 2023Copper Contributor
Many thanks for the clear and lightning fast response ganeshsanap ! Any other non-programming suggestions are welcome, it's basically a union query on 2 tables.
- chanpion13Apr 28, 2021Copper Contributorcan i use filter and KQL custom code at the same time or only one or the other?
- ganeshsanapApr 29, 2021MVP
chanpion13 You can only use either one.
You can use Filter with managed properties by selecting them from dropdown or you can use Custom query & define filters using KQL
Please click Mark as Best Response & Like if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.