0

I am displaying users from certain groups within an SPFx web part for SharePoint Online.

If I try to add a filter I get the error "The specified filter to the reference property query is currently not supported"

It works fine without the filter.

Thanks P

let filterString = "jobTitle eq 'Partner'";
      let filterString = "startswith(mail, 'p')";
      let filterString = "givenName eq 'Pete'";


      var client = await this.context.msGraphClientFactory.getClient('3');
      var result = await client.api('groups/' + this.properties.groupGUID + '/members').filter(filterString).get();
1

1 Answer 1

2

As per official documentation for List Members API you need to add custom header ConsistencyLevel with value "eventual" and also need to add query string parameter $count with value true

See details of Request Header

ConsistencyLevel: eventual. This header and $count are required when using the $search, $filter, $orderby, or OData cast query parameters. It uses an index that might not be up-to-date with recent changes to the object.

You can try below code to use filter in that api which is working in my case

var result = await client.api('groups/groupid/members').headers({
  "ConsistencyLevel":"eventual"
}).count(true).filter("startsWith(mail,'alex')").get();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.