# Filter entities according to user group

**URL:** <https://forum.getodk.org/t/filter-entities-according-to-user-group/56444>\
**Category:** Support\
**Tags:** odk-xlsform\
**Created:** [August 27, 2025, 1:24am UTC](https://forum.getodk.org/t/filter-entities-according-to-user-group/56444 "2025-08-27T01:24:21Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ahblake](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/ahblake/32/22392_2.png) [@ahblake](https://forum.getodk.org/u/ahblake)\
**Post date:** [August 27, 2025, 3:03am UTC](https://forum.getodk.org/t/filter-entities-according-to-user-group/56444/4 "2025-08-27T03:03:35Z")

</div>

You should be able to [access](https://docs.getodk.org/form-question-types/#metadata) the username in the form by adding a field `username`

But are you defining the [username value in the App User QR](https://forum.getodk.org/t/how-to-customise-qr-code-settings-to-include-username/47078) that you provide to the monitors? If not this will be [blank](https://docs.getodk.org/collect-settings/#form-metadata-settings) in Collect. This is different to the _display name_ for the app user but you might want them to be the same value.

You'd also need to build your _list_ of usernames to match the usernames assigned to the app users.

I don't think you need to add `allow_choice_duplicates` to `settings`, you ought to be able to put a space separated list of _zones_ against the _username_ (one entry per user), and the list of **farms** with matching **zones** will filter accordingly (one entry per farm)

username1 might have the zone column as `zone1 zone3 zone99`, username2 might have `zone1 zone99 zone 4` and username2 has `zone2 zone3`. So a farm `farmA` with a value of `zone1` against the zone column should appear for username1, username2 but not username3 when you use the selected function as a choice filter.

---

_[View the full topic](https://forum.getodk.org/t/filter-entities-according-to-user-group/56444)._
