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 365 and Office | OneDrive | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. CarlZhao-MSFT 46,371 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.