-
Notifications
You must be signed in to change notification settings - Fork 103
Description
Describe the bug
When trying to filter driveItems via
https://graph.microsoft.com/v1.0/drives/{{driveId}}/items?$filter=lastModifiedDateTime ge 2025-04-13T09:45:22Z This has no impact on the results, a page with 200 items is being returned, with lastModifiedDateTimes both before and after the specified date.
Similarly filtering on id eq 'xxx' also does nothing and returns all items instead of just the 1 expected match with the specified id
https://graph.microsoft.com/v1.0/drives/{{driveId}}/items?$filter=id eq 'xxxxxx'
To Reproduce
Steps to reproduce the behavior:
- Go to Microsoft Graph Explorer & sign in
- Paste URL https://graph.microsoft.com/v1.0/drives/{{driveId}}/items?$filter=lastModifiedDateTime ge 2025-04-13T09:45:22Z
- Replace {{driveId}} with existing driveId
- See results
Expected behavior
Only items equal to or after the provided lastModifiedDateTime should appear
Screenshots
Desktop (please complete the following information):
- OS: Windows
- Browser: Chrome, Postman, C# application, all same results
Additional context
When I put my provided DateTimeOffset between single quotes ('), I get this response:
"code": "BadRequest",
"message": "Invalid filter clause: A binary operator with incompatible types was detected. Found operand types 'Edm.DateTimeOffset' and 'Edm.String' for operator kind 'GreaterThanOrEqual'.",
Which would indicate that the filter is correctly formatted without the quotes, and the field lastModifiedDateTime is correctly identified, but it is unclear why the response does not filter the fields according to the provided datetime (or id in the other example)
In our application we already had this:
var driveItems = await graphClient.Drives[driveId].Items
.GetAsync(x => { x.QueryParameters.Filter = $"lastModifiedDateTime ge {since:yyyy-MM-ddTHH:mm:ssZ}"; }, cancellationToken);
Which would indicate to me that it used to be working correctly before, but something has changed on the Sharepoint side?
