Forum Discussion
NShivaBarath
Jan 08, 2023Copper Contributor
Issue in formulating the Filter for SharePoint using Microsoft Graph API
I am trying to use the filter to get all the Folders within a specific Document Library. The following throws error saying that Microsoft.Graph.ServiceException HResult=0x80131500 Message=Code: ...
SvenSieverding
Jan 09, 2023Bronze Contributor
Hi NShivaBarath,
i normally use the "FSObjType" in the filter if i want to select folders
var taskSearch = graphClient.Sites[site.Id].Lists["NameOfDocumentlibrary"].Items.Request().Filter("FSObjType eq 1").GetAsync();I like it more, because it does not depend on the folder content type to be named "Folder".
See more documentation here: "https://learn.microsoft.com/en-us/previous-versions/office/sharepoint-csom/ee537053(v=office.15)"
I think you are missing a ")" somewhere in your query.
Best Regards,
Sven