[英]Get the list of items in SharePoint API which starts with "_"
API Call: "https://tponline.sharepoint.com/sites/tc-g-learning/_api/web/lists/GetByTitle('Documents - Learning Centre')/items?$select=_DisplayName,Title,Modified_x0020_By" API 调用: “https://tponline.sharepoint.com/sites/tc-g-learning/_api/web/lists/GetByTitle('Documents - Learning Centre')/items?$select=_DisplayName,Title,Modified_x0020_By”
When only "Title" or "Modified_x0020_By" is filtered, then the result is returned where as if we pass _DisplayName it says error.当仅过滤“Title”或“Modified_x0020_By”时,将返回结果,就好像我们通过 _DisplayName 它表示错误一样。 But when we call API to get list of all item names using 'https://tponline.sharepoint.com/sites/tc-g-learning/_api/web/lists/GetByTitle(''Documents - Learning Centre'')/Fields?$select=Title,InternalName' then we can see _DisplayName in return.
但是当我们调用 API 以使用 'https://tponline.sharepoint.com/sites/tc-g-learning/_api/web/lists/GetByTitle(''Documents - Learning Centre'')/ Fields?$select=Title,InternalName' 然后我们可以看到 _DisplayName 作为回报。
"{
"odata.error": {
"code": "-1, Microsoft.SharePoint.SPException",
"message": {
"lang": "en-US",
"value": "The field or property '_DisplayName' does not exist."
}
}
}"
Note: Tried with some of other items beginning with "_" then we get same error.注意:尝试使用以“_”开头的其他一些项目,然后我们得到同样的错误。
You can first hit the API URL for getting the fields only.您可以先点击 API URL 来获取字段。
URL : https://tponline.sharepoint.com/sites/tc-g-learning/_api/web/lists/GetByTitle('Documents%20-%20Learning%20Centre')/Fields网址: https ://tponline.sharepoint.com/sites/tc-g-learning/_api/web/lists/GetByTitle('Documents%20-%20Learning%20Centre')/Fields
Once you open this, you will see the internal name that is used by API for all the fields in the list.打开后,您将看到 API 用于列表中所有字段的内部名称。
I too had similar problem where my column name was _Status and the internal name was
OData__Status
我也有类似的问题,我的列名是_Status ,内部名称是
OData__Status
Hope that helps !!!希望有帮助!!!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.