Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graphClient.Drives[driveId].Items[driveItemId].Children.GetAsync(config => { config.QueryParameters.Expand = ["listItem"]; }) does not include custom fields in the list item response #2532

Closed
DGV1995 opened this issue Jun 5, 2024 · 2 comments
Labels

Comments

@DGV1995
Copy link

DGV1995 commented Jun 5, 2024

Is your feature request related to a problem? Please describe the problem.

Hello, I have noticed that when calling https://graph.microsoft.com/v1.0/drives/[driveId]/items/[itemId]/children?expand=listItem, the response includes list item custom fields, but when using the Graph SDK in the next way:

graphServiceClient.Drives[driveId].Items[itemId].Children.GetAsync(requestConfiguration =>
{
    requestConfiguration.QueryParameters.Expand = ["listItem"];
});

The response includes the list item, but not the list item custom fields.
Is it possible to have that custom fields in the response?

Thanks!

Describe the solution you'd like.

I would like to have the custom fields (like a custom column in a Sharepoint document) in the ListItem property of the DriveItem response, please.
The only alternative that currently works for me in the next one:

driveItem.ListItem = await graphServiceClient!.Drives[driveId].Items[driveItemId].ListItem.GetAsync(requestConfig =>
{
    requestConfig.QueryParameters.Expand = ["fields"];
});

but this approach requires an additional graph api call for every drive item.

Additional context?

No response

@DGV1995 DGV1995 added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:feature New experience request labels Jun 5, 2024
@andrueastman
Copy link
Member

Thanks for raising this @DGV1995

Are you by any chance able to resolve this if you use a nested expand statement for the fields with code that looks like this?

var result = await graphClient.Drives["{drive-id}"].Items["{driveItem-id}"].Children.GetAsync((requestConfiguration) =>
{
	requestConfiguration.QueryParameters.Expand = new string []{ "listItem($expand=fields)" };
});

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jun 5, 2024
@DGV1995
Copy link
Author

DGV1995 commented Jun 5, 2024

Hi,

Yes, it actually works with that code. Thanks a lot :D

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jun 5, 2024
@DGV1995 DGV1995 closed this as completed Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants