Share via

$filter on fileRef with Graph API

Håvard Notland 20 Reputation points
2024-01-09T12:05:32.5466667+00:00

Hi, we have migrated our API service from SharePoint REST API to Microsoft Graph API and are having some difficulties with filtering. We are unable to filter on "fileRef" using Graph API, this was working with SharePoint REST API.

$filter=fields/FileRef eq 'directory-goes-here' returns empty list even when it should return something.

Ideally I need the "contains" keyword to be supported for FileRef, but I haven't found any keywords that are supported when trying to filter on FileRef.

Is this something that will be supported in the future? Are there any alternative solutions for getting folder path information and using it to filter a specific folder in our query?

Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Graph
0 comments No comments

Answer accepted by question author

RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
2024-01-10T02:19:35.5433333+00:00

Hi @Håvard Notland

Currently graph api only support filter by fields. Filtering by any property is not supported.

I feel regretful to inform you that it turns out to be a by-design one. It is highly recommended that you can vote this ticket. Many features of our current products are designed and upgraded based on customers’ feedback. With requirements like this increase, the problem may well be released in the future. Thanks for your understanding.


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

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.