TCPcloud
TCPcloud

Reputation: 11

Get OneDrive items in default sort order

How can I get folder's items in original sort order? I want to get items in the same order as OneDrive folder has online. I have many folders with custom sort arrangements, but I’m always getting items sorted by name only.

var res = Client
  .Drive
  .Items[FolderId]
  .Request()
  .Expand("children($expand=thumbnails)")
  .GetAsync(); // where FolderId is variable

res.Children always contains items sorted by Name only, no matter what res.Folder.View.SortBy value is.

I'm using Microsoft Graph Client Library.

Upvotes: 1

Views: 1262

Answers (1)

Christian Vorhemus
Christian Vorhemus

Reputation: 2663

Do you use OneDrive or OneDrive for Business?

In OneDrive for Business, Graph only supports sorting by name or url. For personal OneDrive, only name, size, and lastModifiedDateTime.

What parameter do you use for sorting when you access your OneDrive with a browser? Is it sorted by date? If so, I'd suggest to add your vote on the Office User Voice

Upvotes: 1

Related Questions