[英]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.