$filter contains function doesn't work

Vincent Gagnon 6 Reputation points
2021-10-01T19:46:49.793+00:00

This is the error I get: "Unsupported property filter clause operator 'Contains'."

Example in the Graph Explorer

https://graph.microsoft.com/v1.0/users?$filter=contains('m',displayName)

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,381 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,800 questions
{count} vote

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 33,641 Reputation points Microsoft Vendor
    2021-10-04T02:06:27.147+00:00

    Hi @Vincent Gagnon ,
    As far as I know, The contains function are not available for users. You can use startsWith since it's available

    https://graph.microsoft.com/v1.0/users?$filter=startsWith(displayName,'m')  
    

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    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.