简体   繁体   中英

Microsoft graph api null or empty filter not working

I want to filter my tasks which are currently active(not completed). I am using microsoft graph api. I get all my tasks and I found that if I mark task complete it is adding date to completedDateTime property. If task is not completed then it's completedDateTime is null. so I try to get task which has completedDateTime eq null but it is not working. so is there any why to check my active task which are not completed?

I have user v1.0 and beta both none of them are working. After lot of struggle get https://github.com/microsoftgraph/microsoft-graph-docs/issues/239 link which says that null check is possible with beta I tried it and it is working. but null check is not working with my query.

Query where null check working:

GET https://graph.microsoft.com/beta/users?$count=true&$select=id,displayName,surname&$filter=surname eq null
Content-type: application/json
ConsistencyLevel : eventual
Authorization: Bearer {{access_token}}

My query where null check not working:

GET https://graph.microsoft.com/beta/me/planner/tasks?$count=true&$select=planId,title,completedDateTime&$filter=completedDateTime eq null
Content-type: application/json
ConsistencyLevel : eventual
Authorization: Bearer {{access_token}}

I have also tried with percentComplete parameter. If it is 100 means task is completed but it also not working.

GET https://graph.microsoft.com/beta/me/planner/tasks?$count=true&$select=planId,title,percentComplete,completedDateTime&$filter= percentComplete ne 100
Content-type: application/json
ConsistencyLevel : eventual
Authorization: Bearer {{access_token}}

According this filtering is not supported and unfortunately it is not described in the documentation which properties support filtering.

I have tested filtering and it is not possible to filter tasks by any property. It always returns all records.

Similar issue:

GitHub

Microsoft Q&A

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM