【发布时间】:2018-05-01 03:13:04
【问题描述】:
我正在关注Get metadata for a list 的文档。
使用 PowerShell 或图形资源管理器进行查询无法完全展开 SharePoint 列表中项目的字段。
这方面的一个示例是名为 Responsible 的查找字段,它在 Azure Active Directory 中查找用户(或在 SharePoint 术语中,该列是 Person or Group 列,仅限于人员)。
一旦通过 GUI 选择,它就会填充一个显示名称(尽管我希望在后端存储更明确的信息,例如 UPN)。
使用表单查询 Graph API 时:
$Uri = "https://graph.microsoft.com/v1.0/sites/$($SPSite.id)/lists/$($ServiceList.id)/items?expand=fields"
$Data = Invoke-RestMethod -Headers @{Authorization = "Bearer $accesstoken"} -Uri $Uri -Method Get -ErrorAction Stop
我们得到这样的东西:
@odata.etag : "REMOVED"
Title : Storage Platform
Description : Central storage platform
ResponsibleLookupId : 14
Responsible2LookupId : 13
AccountableLookupId : 3
Features : NFS
AudienceLookupId : 92
RequestProcess : {@{LookupId=1; LookupValue=Service Desk}}
Support : {@{LookupId=1; LookupValue=Service Desk}}
AvailabilityLookupId : 1
DependsOn : {}
O365GroupLookupId : 87
LifecycleStageLookupId : 2
ConsultLookupId : 88
id : 1
ContentType : Item
Modified : 2017-11-17T10:47:07Z
Created : 2017-11-17T10:47:07Z
_UIVersionString : 1.0
Attachments : False
Edit :
LinkTitleNoMenu : Storage Platform
LinkTitle : Storage Platform
ItemChildCount : 0
FolderChildCount : 0
_ComplianceFlags :
_ComplianceTag :
_ComplianceTagWrittenTime :
_ComplianceTagUserId :
您可以看到字段ResponsibleLookupId 只给出了14 的值,这没有用。其他字段链接到 Office 365 组,但再次返回值。因此,不可能将任何此类数据链接到用户/组,并且价值非常有限,除非通过门户网站查看。
我们如何扩展这些数据?它会在以后由 API 调用提供,还是我们必须执行进一步的查找?
【问题讨论】:
标签: microsoft-graph-api sharepoint-online