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

Get all files from a specific folder(drive) in Sharepoint site. #2777

Open
MathavanN opened this issue Dec 16, 2024 · 1 comment
Open

Get all files from a specific folder(drive) in Sharepoint site. #2777

MathavanN opened this issue Dec 16, 2024 · 1 comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience

Comments

@MathavanN
Copy link

Describe the bug

I am trying to get files from a specific folder(drive) in Sharepoint.

Microsoft.Graph V5.63.0

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();
}

I am using QueryParameters filter to get the specific folder. I have tested this code and I am sure that the filter works. Application has been running in Live for a while.

Last 2 days (from Dec 14, 2024), I see that the filter is not working. driveItemCollectionResponse contains all files and folders from Sharepoint site.

Result from 14th Dec, 2024
Screenshot 2024-12-16 092219 PNG

Expected behavior

Expected to filter by folder name and webUrl.
Screenshot 2024-12-16 092220

How to reproduce

Get items from a sharepoint drive and apply filter.

SDK Version

5.63.0

Latest version known to work for scenario above?

5.63.0

Known Workarounds

No response

Debug output

Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
@MathavanN MathavanN added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Dec 16, 2024
@MathavanN
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience
Projects
None yet
Development

No branches or pull requests

1 participant