Using Odata conditional operator in query parameter gets error

Gtman Chin 65 Reputation points
2024-01-07T11:24:01.53+00:00

I'm doing test with Graph explorer. When I use following, everything works fine

  1. https://graph.microsoft.com/v1.0/me/drive/root/children?$filter=startsWith(name, 'cdfs')
  2. https://graph.microsoft.com/v1.0/me/drive/root/children?$filter=folder ne null

However, when I add conditional operator to between the two syntaxes, graph returns error:

https://graph.microsoft.com/v1.0/me/drive/root/children?$filter=folder ne null and startsWith(name, 'cdfs')

Does anyone encounter the problem? Or any help?

Thanks.

The returned error codes:

"code": "notSupported",
"message": "Operation not supported",
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,059 questions
0 comments No comments
{count} votes

Accepted answer
  1. AsithwMSFT 1,440 Reputation points Microsoft Vendor
    2024-01-07T22:32:21.95+00:00

    @Gtman Chin

    Even though your filter query format is correct with 'and' operator, as the error response indicates that Graph API filter does not support this.

    However, this doesn’t mean that similar format API queries won’t work in other scenarios.

    It’s just that in this particular case, it doesn’t function as expected due to the limitations of the Graph API filter.

    You have the option to submit a feature request at this location: Microsoft 365 Developer Platform.

    you could request feture from heere https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.