简体   繁体   English

Microsoft Graph API 过滤器 SharePoint 按用户创建的列表项

[英]Microsoft Graph API Filter SharePoint List Items By CreatedBy User

I am using Microsoft Graph API and trying to filter items in a SharePoint List by CreatedBy User but am not sure how to write the filter query.我正在使用 Microsoft Graph API 并尝试通过 CreatedBy User 过滤 SharePoint 列表中的项目,但我不确定如何编写过滤查询。

https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$$filter= https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$$filter=

I have tried "https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?&$filter=AuthorLookupId eq {user-id}" but it doesn't seem to work.我试过“https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?&$filter=AuthorLookupId eq {user-id}”但是它似乎不起作用。

According to my research and testing, unfortunately, there is currently no Graph API can filter items by CreatedBy User.根据我的研究和测试,不幸的是,目前没有图 API 可以按 CreatedBy User 过滤项目。 As a workaround, I recommend you use the following REST API to filter items:作为解决方法,我建议您使用以下 REST API 来过滤项目:

https://xxxxx.sharepoint.com/sites/xxx/_api/web/lists/getbytitle('xxxx')/items?$filter=AuthorId eq 21

Thanks for your understanding.谢谢你的理解。

You can at least filter items by field AuthorLookupId .您至少可以按字段AuthorLookupId过滤项目。 The filtering can be allowed by adding the header Prefer: HonorNonIndexedQueriesWarningMayFailRandomly .可以通过添加 header Prefer: HonorNonIndexedQueriesWarningMayFailRandomly来允许过滤。

GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields&filter=fields/AuthorLookupId eq '10'

GET https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items?$expand=fields&filter=fields/Title eq 'whatever'

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

相关问题 是否可以在打开“读取用户创建的项目”的情况下通过 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? Microsoft Graph API - 检查用户是否拥有 SharePoint 许可证 - Microsoft Graph API - Check if user has a SharePoint license Microsoft Graph API列表位置 - Microsoft Graph API List Locations Microsoft Graph API getSchedule 按日历筛选 - Microsoft Graph API getSchedule filter by calendars Microsoft Graph API:由与会者过滤日历事件 - Microsoft Graph API: Filter Calendar Events by Attendees Microsoft Graph API中与SharePoint相关的所有终结点是什么? - What are all the endpoints in the Microsoft Graph API that are relevant for SharePoint? Microsoft Graph API。获取用户活动 - Microsoft Graph API. Getting user activity 获取 SharePoint API 中以“_”开头的项目列表 - Get the list of items in SharePoint API which starts with "_" Microsoft Graph API odata $filter 查询似乎不起作用 - Microsoft Graph API odata $filter query does not appear to work Microsoft Graph API 共享/驱动器筛选已删除的文件 - Microsoft Graph API shares / drives filter deleted files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM