Ivan Cortez
Ivan Cortez

Reputation: 61

Filter Graph OneDrive DriveItems using Item Type and createdDateTime

I need to make two filters to get either all of the folders or all of the files within a date range using createdDateTime or lastModifiedDateTime in Microsoft Graph™ using OneDrive™ connection, but neither filters works.

Any help would be very appreciated.

https://graph.microsoft.com/v1.0/me/Drives/[drive-Id]/root/Children?$filter=Folder/Childcount $count ge 1
https://graph.microsoft.com/v1.0/me/Drives/[drive-Id]/root/Children?$filter=CreatedDateTime gt 2017-01-01T00:00:00.000Z and CreatedDateTime lt 2017-01-08T00:00:00.000Z

Upvotes: 1

Views: 1178

Answers (1)

Bartosz J
Bartosz J

Reputation: 178

Unfortunately neither filter or even orderby don't work correctly on OneDrive :( You have 2 "workarounds":

  1. Use delta api
  2. Iterate through the drive items and then filter on the client side

Personally I found the 2 options easier to do for me.

Upvotes: 1

Related Questions