Hello Dhruvin Moradiya,
Thanks for reaching out!
To get files in a specific folder based on the given file name please refer to the documentation. Including ParentLink:/FolderName, along with Path should be able to retrieve files and images as well from a parent folder.
POST https://graph.microsoft.com/v1.0/search/query
{
"requests": [
{
"entityTypes": [
"driveItem"
],
"query": {
"queryString": "searchstring AND Path:https://contoso.sharepoint.com/sites/Library/Shared Documents AND ParentLink:/FolderName"
}
}
]
}
Please refer to the similar post:
https://learn.microsoft.com/en-us/answers/questions/702018/graph-api-search-for-driveitems-within-a-drive-doe#answer-704760
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".
Hi @Sayantan Ganguly-MSFT
Can you please help me with this?
I want a single method to limit search or filter to file name only and work for personal and business accounts.
Please check my previous/above comment.