How To Retrieve Custom Columns For DriveItems in MS Graph

ぃ、小莉子 提交于 2019-12-08 17:25:44
Gregg Lestina

I did some testing. What SHOULD work is:

https://graph.microsoft.com/beta/drives/{driveid}/root/children?$select=id,MyCustomColumnName

However, when I did that, it just returned that id field. In my opinion, that is a bug in the graph because this same type of query does work in the SharePoint REST api.

If this helps, you can accomplish this by using the SharePoint REST api. Your endpoint query would be something like:

https://{yoursite}.sharepoint.com/sites/{sitename}/_api/web/lists/(' {DocumentLibraryID}')/items?$select=id,MyCustomColumnName

There are other ways to do the same query.

Try the list endpoint then expand driveItem and fields. You now have both custom column fields and drive item fields.

 /beta/sites/[site-id]/lists/[list-id]/items?expand=driveitem,fields&filter=(fields/customColumn eq 'someValue') 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!