Reputation: 603
I am using below code to get users with matched Display Name:
var users1 = await graphServiceClient.Users.Request().Select(e => new {
e.DisplayName,
e.GivenName,
e.PostalCode
}).Filter($"DisplayName contains 'Robert'")
.GetAsync();
But ,it doesn't show any result. I am also trying to search using wildcards or startswith i.e Filter(startswith('Robert')) But this also doesn't work.
Please help.
Upvotes: 2
Views: 3266
Reputation: 22533
You could try following way
var users1 = await graphServiceClient.Users
.Request()
.Filter("startswith(displayName,'Robert')")
.Select( e => new {
e.DisplayName,
e.GivenName
})
.GetAsync();
Please refer to Official Document for further details.
Upvotes: 1