I am trying to get files from a specific folder(drive) in Sharepoint.
First, I am getting the DriveItem.
My Code:
string filter = $"tolower(Name) eq '{folderName.ToLower()}' and endswith(tolower(WebUrl),'{parentFolderPath.ToLower()}/{folderName.ToLower()}')";
DriveItemCollectionResponse driveItemCollectionResponse = await _graphClient.Drives[_driveId].Items.GetAsync(delegate (RequestConfiguration<ItemsRequestBuilder.ItemsRequestBuilderGetQueryParameters> reqConfig)
{
reqConfig.QueryParameters.Filter = filter;
}, cancellationToken);
if (driveItemCollectionResponse != null && driveItemCollectionResponse.Value != null && driveItemCollectionResponse.Value.Count > 0)
{
driveItem = driveItemCollectionResponse.Value.First();
}
It returns all the files and folders form the Sharepoint. I have tested this code, and I am sure that the filter works. Application has been running in Live for a while.
From Dec 14, 2024, I see that the filter is not working. driveItemCollectionResponse contains all files and folders from Sharepoint site.
Are there any recent changes affecting these API?
I have created Github ticket, https://github.com/microsoftgraph/msgraph-sdk-dotnet/issues/2777