# Relationship Filtering

**URL:** <https://forum.adalo.com/t/relationship-filtering/27114>\
**Category:** Resources & Tutorials\
**Created:** [May 12, 2022, 1:31am UTC](https://forum.adalo.com/t/relationship-filtering/27114 "2022-05-12T01:31:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [May 12, 2022, 1:31am UTC](https://forum.adalo.com/t/relationship-filtering/27114/1 "2022-05-12T01:31:10Z")

</div>

PSABH Series presents relationship filtering example app.

If we want to filter by interests or skills that users have, we can use relationship filtering to do that.

There are 2 different operators, the most common way is AND, which is users must have both interests to be shown, but we can use OR to display users that have at least interests asked.

 ![Screen Shot 2022-05-12 at 7.45.31 AM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/f/4/f4a1148114247bf46aaec9c77e9d9644b6d55d7e.png)

> **[Relationship Filtering](https://previewer.adalo.com/9c564d3d-d2ad-4815-b00b-c1582e6e1082)**
>
> Built with Adalo

 ![Screen Shot 2022-05-12 at 8.15.45 AM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/a/5/a55d6ca2d9ef43d042560b4c620cabd21ea1e8d5.png)  
 ![Screen Shot 2022-05-12 at 8.15.53 AM](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/0/5/05eadc768eb427613cccd73d226aee4a04b71ee8.png)

The above example are using all available filters which are Cooking, Gardening and Marketing, the result of AND filter is just Paul, because Paul exists in all interests/skills.

For OR function, it has all the users.

![compressed 2022-05-12 at 8.21.58 AM (1)](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/1/8/189d0df3c5d576117ce541a1444142160c6476f6.gif)

If we use just 1 filter, AND and OR result would be the same, but if we apply 2 filters, such as in the example, Gardening and then Cooking, the AND result would be just Paul, but OR result would include Bill, Sue, Sara and Paul too.

Hope this will clear some doubts about Adalo’s advanced capabilities.

---

<div class="post-metadata">

**Author:** ![EvilDice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/evildice/32/19788_2.png) [@EvilDice](https://forum.adalo.com/u/EvilDice)\
**Post date:** [May 14, 2022, 12:42am UTC](https://forum.adalo.com/t/relationship-filtering/27114/2 "2022-05-14T00:42:39Z")

</div>

Hi,  
Interesting.  
Filters are OK, but if you want to filter your firends over the filter and/or if the people are in your group using 2 switch?

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [May 14, 2022, 12:55am UTC](https://forum.adalo.com/t/relationship-filtering/27114/3 "2022-05-14T00:55:26Z")

</div>

I didn’t understand the question.

Can you rephrase and use examples ?

What interests do you want to filter and what users should show up ?

---

<div class="post-metadata">

**Author:** ![EvilDice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/evildice/32/19788_2.png) [@EvilDice](https://forum.adalo.com/u/EvilDice)\
**Post date:** [May 14, 2022, 1:07am UTC](https://forum.adalo.com/t/relationship-filtering/27114/4 "2022-05-14T01:07:43Z")

</div>

OK I describe my scenario.  
I have a list of event to filter with those parameter:

1. time (today, tomorrow, this month ecc) but for now this is not important
2. My subscribed event (on/off)
3. My groups events. Show the event of the groups where I am member (on/off)
4. Category of the events (tour, party, congress ecc)
5. Subcategory (depends on the category like for tour, bike, skating, trakking ecc)
6. Difficult (it depends on category to show or not the difficult

For the points 1, 4, 5, and 6 I resolved.  
The problems are the points, 2 and 3.  
Is it more clear.  
Sorry for my english.

Thanks

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [May 14, 2022, 1:19am UTC](https://forum.adalo.com/t/relationship-filtering/27114/5 "2022-05-14T01:19:50Z")

</div>

Okay, this is clearer.

But I am still doing another variation of this app, looks like this could be the favorite. 😃

So, please expect tomorrow or later to get response.

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [May 14, 2022, 1:25pm UTC](https://forum.adalo.com/t/relationship-filtering/27114/6 "2022-05-14T13:25:03Z")

</div>

Hi @EvilDice ,

It turns out that I can’t stop, 10 hours straight, so here it is,

> **[Events Filtering](https://previewer.adalo.com/d0fb26ac-2b11-4c92-93fc-012ab267a989)**
>
> Built with Adalo

If you have questions, please give examples, so we can validate the process, and it also helps you to visualize better.

If you think the result is not right, give the right ones, and have more than 1 case, so I can reverse engineer what you are thinking.

---

<div class="post-metadata">

**Author:** ![EvilDice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/evildice/32/19788_2.png) [@EvilDice](https://forum.adalo.com/u/EvilDice)\
**Post date:** [May 14, 2022, 4:34pm UTC](https://forum.adalo.com/t/relationship-filtering/27114/7 "2022-05-14T16:34:53Z")

</div>

Hi @Yongki ,  
thanks for your time.  
I don’t think your example can help me.  
The follow are the front-end of a user flow:

List of event

 ![Schermata 2022-05-14 alle 18.19.18](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/8/e/8e7254ffe68c55cc07d25d36eef67fa6773cf5e9.png)  
As you can see there are 2 event’s subscribed and one no.  
Clicking on the filte icon on top-right open the filter

 ![Schermata 2022-05-14 alle 18.19.34](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/7/c/7c0875b75a6811dc10392170ad74681e6050a1b5.png)  
I can filter by category and sub category

 ![Schermata 2022-05-14 alle 18.20.03](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/f/7/f7bcf3b416c9f18419ccb4f8468fc9adce956e67.png)  
In this case category tour and sub Montain Bike  
And it works

 ![Schermata 2022-05-14 alle 18.20.19](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/c/4/c4a03fde90f3113806ee3dc1d35524964efca2d8.png)

Now I want to filter just the event I subscribed  
So open the filter again

 ![Schermata 2022-05-14 alle 18.20.32](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/e/d/edd182f0778a71f4550350bf7fc62b0d3db97c4a.png)

and switch the button “show subscribed event”

The result must be the following

 ![Schermata 2022-05-14 alle 18.20.48](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/6/3/63d69f14524bbc11e20e8199adbc267d2d3aa45e.png)

I know I can use bunch of custom lists and play with the visualization to show the combination of the switches.  
But this is just the beginning.  
May be I have to add others switches.  
Is there a way to make some custom filter on just one custom list?

Thanks.

PS.  
I have an idea, but I’m not sure if it works.  
May be this evening I’ll try.

---

<div class="post-metadata">

**Author:** ![Dilon](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dilon/32/39815_2.png) [@Dilon](https://forum.adalo.com/u/Dilon)\
**Post date:** [May 14, 2022, 4:43pm UTC](https://forum.adalo.com/t/relationship-filtering/27114/8 "2022-05-14T16:43:00Z")

</div>

I’m sorry for interfering here!

I guess you are storing subscribed/unsubscribed events in a Many to Many relationship. I believe when you add that filter as a OR in the list it should work!

---

<div class="post-metadata">

**Author:** ![EvilDice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/evildice/32/19788_2.png) [@EvilDice](https://forum.adalo.com/u/EvilDice)\
**Post date:** [May 14, 2022, 4:58pm UTC](https://forum.adalo.com/t/relationship-filtering/27114/9 "2022-05-14T16:58:34Z")

</div>

Hi, thanks for answer, but I don’t think it’s work.  
I tryed and no.  
May be you mean to be implemented in other way.  
The problem with the OR is that you can have a lot of block of AND divided by OR.  
But how you can tell to the system to choice the right block of AND?  
In my case I have 4 combination of swithces possible.  
And the swithces is not related to the event, but on the logged user variable.  
So how can you filter in one list where all users can access at the same List?  
Now I have to go.

Any suggestion is welcome.

And I frogot.  
I have the filter by time… this is an other problem

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [May 15, 2022, 1:13am UTC](https://forum.adalo.com/t/relationship-filtering/27114/10 "2022-05-15T01:13:58Z")

</div>

I wish you given this earlier, I was thinking about dual relationship parameters.

But your need is different than that, so here is the different app,

> **[Events Filtering Type #2](https://previewer.adalo.com/cd38ef52-005f-44e5-a481-aaddd360513e)**
>
> Built with Adalo

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [May 15, 2022, 1:18am UTC](https://forum.adalo.com/t/relationship-filtering/27114/11 "2022-05-15T01:18:12Z")

</div>

OR is used for special need, most of use cases use AND, this is just to demonstrate Adalo’s capability of OR.

---

<div class="post-metadata">

**Author:** ![EvilDice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/evildice/32/19788_2.png) [@EvilDice](https://forum.adalo.com/u/EvilDice)\
**Post date:** [May 15, 2022, 1:42pm UTC](https://forum.adalo.com/t/relationship-filtering/27114/12 "2022-05-15T13:42:49Z")

</div>

Hi @Yongki ,

thanks again for your time.

I saw and test the app you made.

It seems good.

I have little difficult to understand your way to made a demo. Very complicated for my taste 😅

Anyway in this case you use more the one list in the main view and don’t understand why I have to flag “All category” when no category is selected.

There is an issue on city bike sub category, is not listed in subcategory when select the Tour category.

But it’s not important.

As I told before I tested an idea yesterday night.

It is very weird but works perfectly using just one list of events.

![Untitled](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/4/0/401d1edbaddd114a052a395ff1c2caa16683b197.gif)

I create 4 blocks of AND divided by 3 OR and I found a way to force the system to activate just one block instead the others.

4 blocks because I have 4 possible combination of switches in the filter.

In the first block we haven’t no switches. So no filter about those.

Filter by window time.

Filter by Category.

Filter by Sub-Category

Filter by Difficult.

OR

In the second block we have the filter by subscribed. So I added the filter.

The rest of filters is the same.

OR

In the third block we have filter by “my groups”. So I added this filter

The rest of filters is the same.

OR

In the forth block we have bot switches. So I added both filters.

The rest of filters is the same.

Without the option to use brackets in a boolean expression in Adalo, is very difficult to activate just one block because the first condition on the first block is always verified like all others blocks.  
If you put in the first custom filter the otpion of “show unsuscribed events”, you see just those and the subscribed are excluded.  
But I need to see all events (subscribe and unsusbscribed) and when the user want, see just subscribed events.  
May be the user need to see just unsusbscribed events. So I have to modifiy something.

By the way, I found a way to make just one block verified instead the others.

I don’t know if it’s clear the concept… I’ll make a video to explain better.

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [May 15, 2022, 8:54pm UTC](https://forum.adalo.com/t/relationship-filtering/27114/13 "2022-05-15T20:54:13Z")

</div>

I will read later and fix some issues, just need couple of days to cool down.

A quick response, toggling off All Category is easy, just need to update action to false, and I use 1 custom list for this.

Thanks.

---

<div class="post-metadata">

**Author:** ![EvilDice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/evildice/32/19788_2.png) [@EvilDice](https://forum.adalo.com/u/EvilDice)\
**Post date:** [May 15, 2022, 11:15pm UTC](https://forum.adalo.com/t/relationship-filtering/27114/14 "2022-05-15T23:15:45Z")

</div>

Hi @Yongki ,

Are you sure it also works with multiple users?  
Right now the login is unique which makes everything much easier to manage.

Why doesn’t the “all events” list show categories and subcategories?  
For this I thought more than one list was used.

Anyway I’m curious to see how you did the custom filter.

Thanks

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [May 18, 2022, 4:10am UTC](https://forum.adalo.com/t/relationship-filtering/27114/15 "2022-05-18T04:10:01Z")

</div>

Hi,

I have updated the example app (type #2, link above)

This time, it show result in another screen, probably better this way.

I include another demo login, so you have no doubt about multiple users.

About OR blocks, it could be your interpretation about filtering works, you still can achieve it in single custom list, but I use groups inside them (only 2 groups, the events I am Subscribing as true and as false)

You may try it again.

This is just an example app that allows you to see what happen if configured around your requirement.

---

<div class="post-metadata">

**Author:** ![EvilDice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/evildice/32/19788_2.png) [@EvilDice](https://forum.adalo.com/u/EvilDice)\
**Post date:** [May 18, 2022, 8:56am UTC](https://forum.adalo.com/t/relationship-filtering/27114/16 "2022-05-18T08:56:04Z")

</div>

Hey,

I tested but the flag of the group doesn’t work.  
And there is the weird problem of the sub-category “city bike” again.

Anyway.  
I added other features to the original filters 😅

Now the list must show:

- Public event (all user can see the event and subscribe)
- Public event published by a Group (the administrators and the owner can do it; all users can see the event and subscribe)
- Private event assigned to a Group (like before, but just the members of the group can see and subscribe the event)

I resolved it by modifing the first “AND block” (the block without teh switches subscribe and group turned on) and adding a OR to show the Public event applying all the filter.  
In this case the 2 blocks can works together like a normal OR boolean expression.  
I update little bit the other blocks.

IT WORKS!!

With this methods I can create complex filter simulating the brackets in the boolean formula.

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [May 18, 2022, 9:02am UTC](https://forum.adalo.com/t/relationship-filtering/27114/17 "2022-05-18T09:02:30Z")

</div>

Great, happy to hear that.

By redoing and seeing other’s work, it can stimulate us. 😃

---

<div class="post-metadata">

**Author:** ![EvilDice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/evildice/32/19788_2.png) [@EvilDice](https://forum.adalo.com/u/EvilDice)\
**Post date:** [May 18, 2022, 9:05am UTC](https://forum.adalo.com/t/relationship-filtering/27114/18 "2022-05-18T09:05:16Z")

</div>

I’ll try to make a video to explain this method.  
May be it’s a new way and could be useful for all.

---

<div class="post-metadata">

**Author:** ![EvilDice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/evildice/32/19788_2.png) [@EvilDice](https://forum.adalo.com/u/EvilDice)\
**Post date:** [June 4, 2022, 9:00pm UTC](https://forum.adalo.com/t/relationship-filtering/27114/19 "2022-06-04T21:00:05Z")

</div>

Hey @Yongki  
here the video tutorial of my method.

[![](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/3X/c/d/cd939107262a0b2bca5c83d9fb51cd5c1aaea2e1.jpeg "ADALO - How to make a complex custom filter on a list based on logged-in users parameters") ](https://www.youtube.com/watch?v=Sm4J6JvntCc)

---

<div class="post-metadata">

**Author:** ![Yongki](https://avatars.discourse-cdn.com/v4/letter/y/7c8e57/32.png) [@Yongki](https://forum.adalo.com/u/Yongki)\
**Post date:** [June 4, 2022, 9:21pm UTC](https://forum.adalo.com/t/relationship-filtering/27114/20 "2022-06-04T21:21:00Z")

</div>

Hi @EvilDice ,

Congratulations, thanks for sharing.
