$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 Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,987 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,171 questions
0 comments No comments
{count} votes

Accepted answer
  1. RaytheonXie_MSFT 38,646 Reputation points Microsoft Vendor
    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.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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