简体   繁体   English

获取 SharePoint API 中以“_”开头的项目列表

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

相关问题 Microsoft Graph API 过滤器 SharePoint 按用户创建的列表项 - Microsoft Graph API Filter SharePoint List Items By CreatedBy User Paypal API 获取带有项目的发票清单 - Paypal API get invoices list with items 从 api 获取项目到反应列表中 - get items from api into list in react 是否可以在打开“读取用户创建的项目”的情况下通过 Microsoft Graph Api 检索所有 SharePoint 列表项目? - Can I retrieve all the SharePoint list items vis Microsoft Graph Api with 'Read items that were created by the user' turned on? 如何使用 REST API 作为托管应用程序从客户端上传和获取 SharePoint 文档库中的项目? - How to upload and GET the Items in the SharePoint Document Library from client side using REST API as a HOSTED APP? 通过 REST API 获取 SharePoint 文档库中链接项后面的 URL - Get the URL behind link items in SharePoint document library via REST API Sharepoint rest api 获取快捷方式网址 - Sharepoint rest api get shortcuturl 我们可以使用rest api获取SharePoint列表中的所有私有视图吗 - Can we get all of the private views in a SharePoint list using rest api 如何使用SharePoint_api对SharePoint列表进行更新/合并/补丁 - How to do a Update/Merge/Patch to a SharePoint list with SharePoint_api 下载 SharePoint 列表附件 REST API - Download SharePoint List Attachment with REST API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM