Sorting Drives by Name with Microsoft Graph API

Barış Bıkmaz 0 Reputation points
2025-01-07T15:29:19.4933333+00:00

There is an issue with sorting the drives in a SharePoint site by their name using the Microsoft Graph API. According to the documentation, this should be possible, but the results are always returned as an unsorted list. What might be the cause of this problem?

Code Example

https://graph.microsoft.com/v1.0/sites/<site-id>/drives?$orderby=name
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,346 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rajat Vashistha-MSFT 1,400 Reputation points Microsoft External Staff
    2025-01-08T16:28:36.4266667+00:00

    Hi Barış Bıkmaz,

    Thank you for contacting Microsoft!

    I attempted to reproduce the issue on my end and observed the same behavior. When sorting the drives in a SharePoint site by their name using the Microsoft Graph API, the results are consistently returned as an unsorted list.

    Here are the API calls I used:

    https://graph.microsoft.com/v1.0/sites/<site-id>/drives?$orderby=name

    https://graph.microsoft.com/v1.0/sites/<site-id>/drives?$orderby=name ASC

    https://graph.microsoft.com/v1.0/sites/<site-id>/drives?$orderby=name DESC

    I recommend you raise a support case with Microsoft Graph, a Support Engineer will be able to look into this issue and assist you better. You can raise support ticket from New support request - Microsoft Entra admin center or https://admin.microsoft.com/#/support/requests.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.