search inside a folder returns no results in onedrive.

RobertV 41 Reputation points

I'm adding a file search function to my code. Search works fine on root level. But searching inside a folder gives no results.*onedrive id*/items/root id/search(q='testseach')

Returns a 200 with the file data.*onedrive id*/items/folder id/search(q='testseach') *

Folder id is a driveitem containing the file im looking for.
Returns a 200 and an empty list.

I have tried this search on a Teams drive. There It works as intended and I do get results back on a search inside other folders.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,139 questions
0 comments No comments
{count} votes

Accepted answer
  1. Shivam Dhiman 5,951 Reputation points

    Hi @RobertV

    I am not able to replicate your issue its giving me desired output. As you can see I am able to retrieve file present inside Testing Folder in my OneDrive.



    Further you can refer to these similar posts-
    Graph Drive Search - does not return all file types
    Graph API Search for DriveItems within a drive

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

0 additional answers

Sort by: Most helpful