OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Micorsoft Graph - Search query not getting results

  • Thread starter Thread starter MonkeySleeve
  • Start date Start date
M

MonkeySleeve

Guest
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.

enter image description here

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

Code:
{
"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?

Edit; And just after i post this question, i try it again in Graph Explorer and for some reason it does return a result? Microsoft seems to be trolling me...
<p>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.</p>
<p>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.</p>
<p>So here's the folder Reports that has a few sub folders with unique identifiers in their folder name.</p>
<p><a href="https://i.sstatic.net/GPf9w1yQ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/GPf9w1yQ.png" alt="enter image description here" /></a></p>
<p>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.</p>
<p>When I try to find the folder with [1408] in the name I don't get any results back via the following endpoint <a href="https://graph.microsoft.com/v1.0/search/query" rel="nofollow noreferrer">https://graph.microsoft.com/v1.0/search/query</a></p>
<pre><code>{
"requests": [
{
"entityTypes": [
"driveItem"
],
"query": {
"queryString": "filename:\"[1408]\" AND Path: https://<sharepointsite>/Shared%20Documents/Sharepoint/bemetdocrepo/Reports/"
}
}
]}
</code></pre>
<p>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?</p>
<p>Edit; And just after i post this question, i try it again in Graph Explorer and for some reason it does return a result? Microsoft seems to be trolling me...</p>
Continue reading...
 

Latest posts

S
Replies
0
Views
1
Safwan Aipuram
S
Top