I have a Sharepoint site setup and made a whole structure with folders to divide our attachments in a neat order. But when i need to look up certain folders I needed to have a way of finding the correct folders based on an ID within my system.
So what I did was I’ve added [] to the folder names and use that to look it up via the search/query endpoint in MS Graph. But for some reason this seems to be highly inconsistent.
So here’s the folder Reports that has a few sub folders with unique identifiers in their folder name.
When I navigate to this Reports folder in MS Graph and ask it to list it’s children, I get all of them back in the result. So they do exists according to MS Graph.
When I try to find the folder with [1408] in the name I don’t get any results back via the following endpoint https://graph.microsoft.com/v1.0/search/query
{
"requests": [
{
"entityTypes": [
"driveItem"
],
"query": {
"queryString": "filename:"[1408]" AND Path: https://<sharepointsite>/Shared%20Documents/Sharepoint/bemetdocrepo/Reports/"
}
}
]}
But if I look for the folder with [590] in the name, I do get a result back. The [1337] also gives a result but the others for some reason don’t. What am I doing wrong here?