$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 365 and Office | SharePoint | Development
Microsoft Security | Microsoft Graph
{count} vote

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,481 Reputation points Microsoft External Staff
    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.


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.