Learn how to show the content from a folder in the highlighted content webpart
The standard SharePoint webpart highlighted content can show specific files from your site, using standard filtering.
But what if you want to show files from another site.
To achieve this you can use the custom query and write
path:"https://tenant.sharepoint.com/sites/yoursitename/Shared Documents
Replace tenant and yoursitename, and if you are not using the standard document library, change the Shared Documents with the name of your library.
If you have a sub-folder inside your documents library, we can see the folder now, but what if you would like to show the content of that folder (the files inside that folder)
The obvious thing to do would be to just add the full path to that folder
path:"https://tenant.sharepoint.com/sites/yoursitename/Shared Documents/Folder name
But the result we get will look like this
We are only seeing the folders - not the content of the folders as your might expect.
The solution
We need to use a different type of query to get the value of what is inside the sub-folder
DocumentLink:"https://tenant.sharepoint.com/sites/yoursitename/Shared Documents/Test Folder/*"
AND FileType:*
The AND FileType:* is used to remove all items that is not a file type. You can leave it out if you want.
Now you know how to show the content of your folders, using the highlighted content standard webpart
See also
- Make a download button for SharePoint Library files
- Update metadata for locked/checked out/need approval files
- Disable the folder ID for SharePoint document integration
- Trigger a Power Automate Flow with modern ribbon, with a custom button in Dynamics 365 (not Ribbon Workbench)
- Make an API request with a custom button (Modern Ribbon)