You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用Graph API单次查询获取SharePoint查找字段关联列表字段?

实现SharePoint查找字段关联数据的单次Graph API查询

可以通过单次Graph API查询直接获取Region列表关联的Markets列表字段,无需单独查询Markets列表。

核心是利用Graph API的**嵌套展开(nested expand)**能力,对查找字段进行深层展开,同时指定需要返回的关联列表字段。

示例请求URL

GET https://graph.microsoft.com/v1.0/sites/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/lists/REGION/items?expand=fields($expand=Markets;$select=PVRegion,Markets)&$select=id,fields&filter=fields/MarketsLookupId eq 1

参数说明

  • expand=fields($expand=Markets;$select=PVRegion,Markets):
    • 先展开Region列表的fields集合
    • 在fields内部,进一步展开查找字段Markets(关联到Markets列表)
    • 同时指定需要返回的Region字段PVRegion,以及查找字段Markets的入口
  • $select=id,fields:指定返回Region列表项的基础ID和展开后的fields数据
  • filter=fields/MarketsLookupId eq 1:保留你原有的过滤条件,筛选关联Markets ID为1的Region项

返回结果说明

返回的每个Region列表项中,fields下的Markets字段会包含Markets列表中对应的PVOps、LinkTitle等字段数据,无需额外请求。

注意:确保你的Graph API权限同时允许访问Region列表和Markets列表,且指定的字段名称(如PVOps、LinkTitle)与Markets列表中的实际内部名称一致。

内容的提问来源于stack exchange,提问作者felixmondelo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 21:25:52