# Show collection of users with any of a set of attributes, without showing the current user

**URL:** <https://community.glideapps.com/t/show-collection-of-users-with-any-of-a-set-of-attributes-without-showing-the-current-user/67561>\
**Category:** Ask for Help\
**Created:** [November 6, 2023, 11:41am UTC](https://community.glideapps.com/t/show-collection-of-users-with-any-of-a-set-of-attributes-without-showing-the-current-user/67561 "2023-11-06T11:41:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darri\_D](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darri_d/32/66115_2.png) [@Darri\_D](https://community.glideapps.com/u/Darri_D)\
**Post date:** [November 6, 2023, 11:41am UTC](https://community.glideapps.com/t/show-collection-of-users-with-any-of-a-set-of-attributes-without-showing-the-current-user/67561/1 "2023-11-06T11:41:45Z")

</div>

I want to be able to show a Grid component with source table ‘Users’ that shows other users who speak any of the languages spoken by the current user. I do not want the component showing the current logged-in user in the grid.

I’ve managed to do this using filters with the OR operator, with a condition for each language spoken by current logged-in user, so something like this:

`LangArray contains(UserProfile.lang1) OR LangArray contains(UserProfile.lang2) OR LangArray contains(UserProfile.lang3)`

Of course, with this approach the component always includes the current user in the list, which isn’t ideal.

Is there a way to achieve what I want? The simplest solution would be for the filter to combine both AND and OR operators, but this doesn’t seem to be an option currently. Something like this:

`user_id !== UserProfile.user_id AND (LangArray contains(UserProfile.lang1) OR LangArray contains(UserProfile.lang2) OR LangArray contains(UserProfile.lang3))`

Thanks.

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [November 6, 2023, 1:28pm UTC](https://community.glideapps.com/t/show-collection-of-users-with-any-of-a-set-of-attributes-without-showing-the-current-user/67561/2 "2023-11-06T13:28:57Z")

</div>

Unfortunately, for some reason Glide does not allow us to mix AND and OR logic so we have to utilize some workarounds and twist our logic around a bit to make it work.

You will need to move this logic into your user table. Maybe create an IF column that looks something like this.

```auto
IF email IS UserProfile.email Then false
ELSEIF LangArray contains(UserProfile.lang1) Then true 
ELSEIF LangArray contains(UserProfile.lang2) Then true 
ELSEIF LangArray contains(UserProfile.lang3) Then true 
ELSE false

```

This will give you a boolean that you can use for your filter. Just set your grid filter to check if the boolean is checked.

---

<div class="post-metadata">

**Author:** ![Darri\_D](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darri_d/32/66115_2.png) [@Darri\_D](https://community.glideapps.com/u/Darri_D)\
**Post date:** [November 6, 2023, 2:13pm UTC](https://community.glideapps.com/t/show-collection-of-users-with-any-of-a-set-of-attributes-without-showing-the-current-user/67561/3 "2023-11-06T14:13:20Z")

</div>

Thanks Jeff, this makes a lot of sense, will give it a try. Looking forward to the day when Glide offers more powerful filters!

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [November 13, 2023, 2:13pm UTC](https://community.glideapps.com/t/show-collection-of-users-with-any-of-a-set-of-attributes-without-showing-the-current-user/67561/4 "2023-11-13T14:13:35Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
