Failed to filter based on file property in MS Graph API

Dai, Coco 5 Reputation points
2024-05-13T03:23:37.54+00:00

https://graph.microsoft.com/v1.0/me/drive/root:/{folderName}:/children?$top={top}&$filter={filter}, {filter}=file eq null, this Graph API works before, but now it return

"error": {

    "code": "notSupported",

    "message": "Operation not supported"

}
```for some outlook acocunt, while works on some other account. 

The description in [https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/filtering-results?view=odsp-graph-online#filterable-properties](https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/filtering-results?view=odsp-graph-online#filterable-properties) is confusing, it seems to say 1. it only support filter on name and url, and also  2. all properties(including file and folder) but some properties are not so efficient? 

I‘d like to know whether file/folder is supported for filter. Hopefully current failure is a bug which would be fixed. 

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,326 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,157 questions
OneDrive Management
OneDrive Management
OneDrive: A Microsoft file hosting and synchronization service.Management: The act or process of organizing, handling, directing or controlling something.
1,281 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 42,611 Reputation points
    2024-05-13T08:41:15.1433333+00:00

    Hi @Dai, Coco

    Please check your drive type, for OneDrive for Business, SharePoint Online and SharePoint Server 2016, filtering support only name and url properties.

    User's image

    Hope this helps.

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


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.