Can KQL Show Documents Viewed by the Current SharePoint User?
Question details
The user wants to know if they can configure the Highlighted Content web part using KQL to display only the documents that have been viewed by the currently logged-in user.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- Setting up a personalized SharePoint site page where users can quickly access the files they have recently viewed.
- Observed behavior
- SharePoint Online lacks a built-in KQL property to filter content strictly by the current user's viewing history within a specific site, limiting the Highlighted Content web part.
Ensure you have the necessary 'Edit' permissions for the SharePoint site page to add and configure new web parts.
Use the Recent Documents Web Part
Since KQL cannot filter by viewed history, the best built-in alternative is to use the Recent Documents web part to display files recently accessed by the logged-in user.
The Recent Documents web part is a native SharePoint feature that automatically displays the most recent documents accessed by the current user.
While it effectively shows viewed documents, note that it applies broadly across the user's entire Microsoft 365 environment (including OneDrive and other sites), rather than being limited to the current SharePoint site.
Navigate to the SharePoint page where you want to show the documents and click the 'Edit' button in the top right corner.
Hover your mouse over the page canvas to reveal the plus (+) icon. Click it and search for 'Recent documents' in the web part search box.
Select the 'Recent documents' web part to add it to your page. Once added, click 'Republish' to save the page. It will now display recently viewed files for whoever is currently logged in.

Configure Highlighted Content with Alternative Filters
Use the Highlighted Content web part with alternative user-centric filters, such as documents created or modified by the current user.
Manage and View Your Documents Seamlessly with WPS Office
While SharePoint web parts may have strict configuration limitations for tracking recently viewed files, managing your daily offline and local documents is much easier. WPS Office provides a lightweight, fully compatible, and highly intuitive platform to handle all your word processing, spreadsheet, and presentation tasks.
- 1. Download the Installer: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the Software: Run the downloaded setup file and follow the straightforward on-screen instructions to install the suite.
- 3. Open and Edit Your Files: Launch WPS Office to instantly open your existing Microsoft Office files, view your recent document history, and start editing without formatting loss.

Frequently Asked Questions
Why doesn't the SharePoint Highlighted Content web part support a 'viewed by current user' filter?
The Highlighted Content web part relies on SharePoint Search and KQL (Keyword Query Language) properties. Currently, the search index tracks document modifications and creations but does not expose a user-specific 'viewed' property for custom query filtering.
Can I restrict the Recent Documents web part to only show files from one specific SharePoint site?
No, the Recent Documents web part is designed to display a user's recently accessed files from across their entire Microsoft 365 environment, including OneDrive and other SharePoint sites. It currently lacks the configuration options to scope it to a single site.
Is there any way to submit a feature request for this KQL property?
Yes, Microsoft actively monitors user feedback. You can submit your feature request or vote on similar existing ideas regarding KQL tracking for viewed documents through the official Microsoft Feedback portal.




