2

I am listing the children in the root of a document library with custom columns. When I make the following call with the MS graph REST API, no custom column data is returned for the child items.

https://graph.microsoft.com/beta/sites/<site-id>/drive/root/children

I have tried using ?expand=... without success. Is this possible with either the v1 or beta endpoints?

0

1 Answer 1

4

Endpoint GET https://graph.microsoft.com/beta/sites/<site-id>/drive/root/children returns the collection of files metadata (DriveItem resource) in the root of the drive.

The associated document library list items could be retrieved via DriveItem.listItem property including the values of the columns set on this list item (via ListItem.fields property) like this:

https://graph.microsoft.com/v1.0/sites/root/drive/root/children?$expand=listItem($expand=fields) 

Alternatively, SharePoint Library list items and column values (including custom ones) could be retrieved instead:

GET https://graph.microsoft.com/v1.0/sites/root/drive/list/items?$expand=fields

or list items along with files metadata:

GET https://graph.microsoft.com/v1.0/sites/root/drive/list/items?$expand=fields,driveItem
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. Could you help me understand how I could have figured this out from the documentation? I felt it wasn't clear.
Basically, Relationships properties contains the list of all the associated entities that could be retrieved along with DriveItem resource
I see. Thanks again!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.