繁体   English   中英

如何使用rest在sharepoint文档库中展开lookupfield

[英]How to expand a lookupfield in a sharepoint document library using rest

我有一个带有一些自定义列的SharePoint(SP)库。 其中一列包含指向SP列表的查找字段。

我需要检索列表中的文档和所有自定义字段,包括查找列表中的字段(连接)。

有关此topc的stackoverflow有一些问答,但它们是关于SP列表而不是SP文档库。

这是我到现在为止所提出的(使用javascript执行GET):

{
"url": "sites/mysite/_api/Web/GetFolderByServerRelativeUrl('/sites/mysite/myfilelibrary')
/files?$select=Name,LinkingUrl,TimeCreated,TimeLastModified,Title,ListItemAllFields
&$expand=ListItemAllFields/myListIdId"
}

结果如下:

{
"value": [
    {
        "ListItemAllFields": {
            "FileSystemObjectType": 0,
            "Id": 1,
            "ServerRedirectedEmbedUrl": "https://mydomain.sharepoint.com/sites/mysite/_layouts/15/WopiFrame.aspx?sourcedoc={abababab-efff-4e69-94de-128ff7c14256}&action=interactivepreview",
            "ContentTypeId": "0x010100769480B9F5404447A43367BFC5B86AAB",
            "Title": null,
            "checkResponsible": null,
>>>>>>>>>>>>"myListIdId": 15, <<<<<<<<<<<<<<<<<<<<<
            "SharedWithUsersId": null,
            "SharedWithDetails": null,
            "ID": 1,
            "Created": "2016-07-25T06:04:56",
            "AuthorId": 9,
            "Modified": "2016-07-26T15:11:27",
            "EditorId": 11,
            "OData__CopySource": null,
            "CheckoutUserId": null,
            "OData__UIVersionString": "9.0",
            "GUID": "898770aa-da56-40ae-9db1-430bba2da9bd"
        },
        "LinkingUrl": "https://mydomain.sharepoint.com/sites/mysite/myFileLibrary/Document.docx?d=w3028f42eefff4e6994de128ff7cd6e48",
        "Name": "Document.docx",
        "TimeCreated": "2016-07-25T13:04:56Z",
        "TimeLastModified": "2016-07-26T22:11:27Z",
        "Title": ""
    }
]
}

返回字段myListIdId但未展开。

$expand=ListItemAllFields/myListIdId

应该做的伎俩,但显然它没有。 我错过了什么?

根据本文 ,您在select参数中指定扩展字段。

修订:

“... $ select = Name,LinkingUrl,TimeCreated,TimeLastModified,Title,ListItemAllFields / myListIdId&$ expand = ListItemAllFields”

暂无
暂无

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

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