【问题标题】:Filter SharePoint library items by lookup column using Graph API使用 Graph API 按查找列筛选 SharePoint 库项目
【发布时间】:2021-12-21 12:53:39
【问题描述】:

我有一个 SharePoint 列表和一个文档库。每个文档都使用自定义字段 CustomRecordLookupId 链接到我的列表中的一个项目

如果我选择所有文档并使用 $expand=listitem,我可以在结果中看到 CustomRecordLookupId 值。

但是,我无法使用此查找列进行查询。

https://graph.microsoft.com/v1.0/drives/{drive_id}/root/children?$expand=listitem&$filter=listitem/fields/CustomRecordLookupId eq 1

错误是:Operation not supported

【问题讨论】:

    标签: microsoft-graph-api sharepoint-online


    【解决方案1】:

    根据我的测试,我得到了和你一样的结果。驱动项不支持此功能,您应该对列表项进行过滤:

    https://graph.microsoft.com/v1.0/sites/{site_id}/lists/{list_id}/items?$expand=fields&$filter=fields/CustomRecordLookupId eq 1
    

    【讨论】:

    • 这不会从文档库中返回任何内容。我需要将所有文档过滤为仅适用于 CustomRecordLookupId = 1 的文档
    • 您可以在端点中展开 driveitem 属性,如下所示:$expand=fields,driveitem&$filter=fields/CustomRecordLookupId eq 1
    • 我没有意识到您可以使用列表端点查询库。很有帮助,谢谢。
    猜你喜欢
    • 2018-11-28
    • 2022-11-09
    • 1970-01-01
    • 2017-04-18
    • 1970-01-01
    • 1970-01-01
    • 2017-12-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多