A USERS collection contains a USERGROUPS navigation property.
Users are accessed through /api/Users?$expand=USERGROUPS
.
USERGROUPS navigation property contains ID, and I would like to filter by UserGroups.Id by something like:
/api/Users?$expand=USERGROUPS&$filter=startswith(USERGROUPS/ID,'a')
Ultimately I'd like to be able to filter on a specific group ID value.
Thanks.
Actually OData V3 supports something like that with the any/all operator. So for example if you want to search for all users which belong to user group with id 'a' the query would look something like:
/api/Users?$filter=USERGROUPS/any(usergroup: usergroup/ID eq 'a')
Note though, that the feature is only supported in OData V3, so you need to enable that on the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With