SharePoint Document Issues

How to Fix SharePoint CSOM Queries Omitting Deleted Items

Steven ParkerSteven Parker Oct 23, 2026 868 views

Question details

The user needs to retrieve a complete log of changes including deleted items or files using a SharePoint CSOM change query, but the query is currently only returning added and updated items.

How to Fix SharePoint CSOM Queries Omitting Deleted Items
Product
SharePoint
Device & OS
not provided
Scenario
Using CSOM (Client-Side Object Model) to track and query recent changes in a SharePoint list or document library.
Observed behavior
The CSOM change query successfully retrieves added and updated items but completely omits deleted items and files from the results.
Before you start

Before modifying your CSOM scripts, verify that you have the correct SharePoint site URL and adequate developer permissions to query the site's change logs.

Solution 1Recommended

Configure ChangeQuery Properties to Include Deletions

Update the ChangeQuery object configuration in your CSOM code to explicitly request item and file deletion changes.

SharePoint CSOM requires explicit instructions on which change operations to track. If deletion properties are not enabled in your ChangeQuery object, the API will filter them out by default.

1
Enable Delete Operations

In your C# or JavaScript code, set the 'ItemDeleted' and 'FileDeleted' properties of your 'ChangeQuery' object to 'true' to ensure deletions are captured.

2
Validate Change Tokens

Check the starting 'ChangeToken' being passed to the query to ensure it accurately reflects the timestamp from which you want to track changes.

3
Review Filtering Logic

Inspect your script to ensure no custom conditions or external logic are inadvertently hiding or excluding delete operations from the final printed results.

Configure ChangeQuery Properties to Include Deletions
Configuration Check: By explicitly enabling deletion tracking, your CSOM payload will return the required Unique IDs for deleted files and list items.
Free Microsoft Office alternative

Streamline Document Editing with WPS Office

While SharePoint handles complex backend queries and versioning, managing the actual document contents should be straightforward. WPS Office offers a free, lightweight, and fully compatible suite for editing your Microsoft Office files without the hassle.

  1. 1. Download and Install: Visit the official WPS Office website to download the free suite and install it on your device.
  2. 2. Open Your Documents: Launch WPS Office and open your existing Word, Excel, or PowerPoint files without losing any formatting.
  3. 3. Edit and Save: Make your edits locally and save them seamlessly, ready to be uploaded back to your SharePoint libraries.
Fully compatible with Microsoft Office formats like .docx, .xlsx, and .pptx.Lightweight installation and lightning-fast document loading times.Familiar user interface allowing for a seamless transition.Built-in PDF editing tools for comprehensive document management.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my SharePoint CSOM query only return added items?

This typically happens if the ChangeQuery object is not properly configured to track other operations. You must explicitly set properties like ItemUpdated, ItemDeleted, or FileDeleted to true to retrieve those specific changes.

What is a ChangeToken in SharePoint CSOM?

A ChangeToken is a unique identifier used by SharePoint to mark a specific point in time in the change log. Passing a specific ChangeToken to your query ensures you only retrieve changes that occurred after that exact moment.

Can I recover items deleted by CSOM scripts?

Yes, items deleted via standard CSOM operations usually go to the SharePoint site's recycle bin, unless they were permanently deleted using specific methods that explicitly bypass the recycle bin.