简体   繁体   English

Microsoft graph api null 或空过滤器不起作用

[英]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.我正在使用微软图 api。 I get all my tasks and I found that if I mark task complete it is adding date to completedDateTime property.我得到了我的所有任务,我发现如果我将任务标记为完成,它会将日期添加到 completedDateTime 属性。 If task is not completed then it's completedDateTime is null.如果任务未完成,则完成日期时间为 null。 so I try to get task which has completedDateTime eq null but it is not working.所以我尝试获取已完成DateTime eq null 的任务,但它不工作。 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.我有用户 v1.0 和 beta 都没有工作。 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.经过大量的努力,得到https://github.com/microsoftgraph/microsoft-graph-docs/issues/239链接,上面写着 null 检查是可能的,我试过了,它正在工作。 but null check is not working with my query.但 null 检查不适用于我的查询。

Query where null check working:查询 null 检查工作的位置:

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:我的查询 null 检查不起作用:

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.我也尝试过使用 percentComplete 参数。 If it is 100 means task is completed but it also not working.如果它是 100 表示任务已完成,但它也无法正常工作。

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 GitHub

Microsoft Q&A 微软问答

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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