# How to filter a User List to exclude Current User's Blocked Users

**URL:** <https://forum.adalo.com/t/how-to-filter-a-user-list-to-exclude-current-users-blocked-users/9230>\
**Category:** Get Help\
**Created:** [February 15, 2021, 2:45pm UTC](https://forum.adalo.com/t/how-to-filter-a-user-list-to-exclude-current-users-blocked-users/9230 "2021-02-15T14:45:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Repackaged](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/repackaged/32/6573_2.png) [@Repackaged](https://forum.adalo.com/u/Repackaged)\
**Post date:** [February 15, 2021, 2:45pm UTC](https://forum.adalo.com/t/how-to-filter-a-user-list-to-exclude-current-users-blocked-users/9230/1 "2021-02-15T14:45:49Z")

</div>

Hi everyone.  
I have a user generated content app in which we need to provide the ability for users to block other users.  
In the User database, we have added a BlockedUsers (\* to \*) so that every user can add other users to block.

Now the issue I have is on one of the app screens where we list all users. This screen needs to be filtered out to only display users who are not blocked by the current logged in user. This is where I need help in creating this filter please.  
This is what I have.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/2/24225ba0a1b7cb1e191127a04196b72d64ee7bc6.png)

I am not finding the ability to select all User and then add a filter to _exclude_ any user who’s also in the BlockedUsers property.

Appreciate the help as I am stuck and the app was rejected by Apple unless I include this capability.  
Thanks

---

<div class="post-metadata">

**Author:** ![crmorris2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/crmorris2/32/5681_2.png) [@crmorris2](https://forum.adalo.com/u/crmorris2)\
**Post date:** [February 15, 2021, 4:54pm UTC](https://forum.adalo.com/t/how-to-filter-a-user-list-to-exclude-current-users-blocked-users/9230/2 "2021-02-15T16:54:15Z")

</div>

For this I would add a relationship with user (one to many) and name it ‘blocked by user’. When you block a user, update the blocked user ‘blocked by user’ field with logged in user.

Then when filtering you can filter it by saying ‘blocked by user’ does not contain logged in user.

Hope this helps.

Cheers  
Craig

---

<div class="post-metadata">

**Author:** ![Repackaged](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/repackaged/32/6573_2.png) [@Repackaged](https://forum.adalo.com/u/Repackaged)\
**Post date:** [February 15, 2021, 5:11pm UTC](https://forum.adalo.com/t/how-to-filter-a-user-list-to-exclude-current-users-blocked-users/9230/3 "2021-02-15T17:11:52Z")

</div>

Thank you Craig.  
However in this case the Blocked User can only be blocked by one user at a time.  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/b/b21215fd7972a0b3703659a3b371fd6b5740895b.png)

I would’ve thought it would be a many to many relationship as one user can block many users and a blocked user can be blocked by many users. In this case, I don’t know how to make the filtering work  
Thoughts?

---

<div class="post-metadata">

**Author:** ![Repackaged](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/repackaged/32/6573_2.png) [@Repackaged](https://forum.adalo.com/u/Repackaged)\
**Post date:** [February 15, 2021, 6:26pm UTC](https://forum.adalo.com/t/how-to-filter-a-user-list-to-exclude-current-users-blocked-users/9230/4 "2021-02-15T18:26:55Z")

</div>

Progress here:

![image](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/f/f39e90ad1c2b5b1c32f623c64e050d8231fd4e8b.png)

It works fine now.  
Thank you @crmorris2 for steering me into the right direction

---

<div class="post-metadata">

**Author:** ![crmorris2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/crmorris2/32/5681_2.png) [@crmorris2](https://forum.adalo.com/u/crmorris2)\
**Post date:** [February 15, 2021, 6:40pm UTC](https://forum.adalo.com/t/how-to-filter-a-user-list-to-exclude-current-users-blocked-users/9230/5 "2021-02-15T18:40:48Z")

</div>

A user cannot block themselves so a many to many relationship is not needed here. Because you are only updating one field with data and that data will only be used by an individual user then a one to many is all that is needed.

---

<div class="post-metadata">

**Author:** ![crmorris2](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/crmorris2/32/5681_2.png) [@crmorris2](https://forum.adalo.com/u/crmorris2)\
**Post date:** [February 15, 2021, 6:41pm UTC](https://forum.adalo.com/t/how-to-filter-a-user-list-to-exclude-current-users-blocked-users/9230/6 "2021-02-15T18:41:33Z")

</div>

Glad it worked for you 😀

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [February 25, 2021, 6:42pm UTC](https://forum.adalo.com/t/how-to-filter-a-user-list-to-exclude-current-users-blocked-users/9230/7 "2021-02-25T18:42:12Z")

</div>

Closed on February 25, 2021, 6:42pm UTC

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