Complex list filtering

Hello… broke my head already… but can’t understand how:

I have a database of events for example lessons… they have lots of parameters ( start time, end time, name, category and etc)…

i want to let user choose which catetories ( not only one category as i can do with dropdown menu)… to see in the list considering other filters such as time/class and etc.

I have modal screen with toggles where user chooses which lessons he wants to see in the list.

How to do it?

I have a custom filter with lots of conditions for example : Date , Time - so i can see only lessons that starts today.

But i want them to filter among already made list lessons with multiply categories ( science, literature, maths etc)…

I want to make user choose which categories of lessons they can see for date/time filter( today).

I know how to do it with one single category… but how to let them choose all of them or two out of five and etc?

Hi @Vitiniel ,

There is an example app related to this,

If you are interested, please comment there.

Thanks for answer, but without looking into project itself it’s hard to understand :frowning:
My filter works like this right now:

I have a list with lessons…which i filter by:

  • start time is between current time and tomorrow AND
  • is single time lesson (it means not series of courses) AND
  • is free

According to this AND filters i got my list.

What i’m trying to do… is to make somehow a screen with toggles where i can toggle for current user which categories he wants to see…

But my problem that if i add AND filter - i can filter only by one category… i cannot add a filter group inside a main filters… so i can’t filter all those results that i got from first filter again but by categories now :frowning:

I really wonder is it really possible to do multiselection for categories inside already filtered results :frowning:

It is possible.

It’s tricky to make it work properly but it’s possible.

Here some useful ideas:

price is not a problem…
I have custom filter with three or four ANDS… that works pretty good… after that i got a list…
and i need to filter it by multiple conditions…

if i add only filter by one category it’s just another AND and that’s easy…

but what i have to do if i need to check for something in USER LOGGED that keeps track of which toggles in another screen are on… and i have to filter only by those categories?

To do it… i need somehow to put this temporary info into Sessions database ( which list i want to filter)…
i thought of making somekind of Filtred_Category parametr in Users so i can keep there “text string” with numbers that represents each category… if 9 categories so i will have like string 123456789 if one of them turned off it will be 0.
And my idea was to check if Sessions category number exists in this string… but in adalo i have only Contains. :frowning: and i’m stuck :frowning:

i checked all those custom searchs via invisible input field or anything but it not works in my case… these search bars allows user by searching all text that contained in that search field… but i have time and etc… and honestly i don’t understand how to do this filter if i don’t need search bar…

I got a list filtered by some conditions (time and etc)… now i want to check if toggles for specific categories in User logged are for visible - i want to see only these events from already filtered list… the rest ignored.

the only thing in my mind make lots of filter combinations for each case… but i have 9 categories… and it’s not possible to put all these combinations into adalo.

Maybe anyway can make a demo? For example we have a list which first filtered by time ( for example events for today and ignores every other)… and then filter it again by choosen categories?

i can’t understand how to impletemnt search bar into it :frowning:

You are right, you should create a parameter in Users database to save each user filter preference.

  1. Create 9 properties in Users BUT instead of number use a text property, if it is ON will be 1 if it is OFF will be empty (no 0 nor text empty) i mean no data saved there.
  2. Then use 18 buttons (only 9 visible) to display if the User has each property turned ON (1) or OFF (empty) check https://www.youtube.com/watch?v=77IAZ-Tqcxw&t=167s
  3. Set 9 new filters in lessons list, for example: category 9 IS EQUAL TO Logged in User > category 9 preference.

This should work but it is also possible using toggle components and using a search index parameter but it will take me to explain some workarounds that are kinda messy.

Here some other helpful ideas regarding filters:

What you wrote is working for one selection … i checked all those videos…
every one of them have only one filter… that is by search string…

If i will do how u said… i think i will face this situation :frowning: For example 2 categories i will include in user Cat_1_choice and Cat_2_choice and it will be 1 or 0 for example. It will be controlled by toggles or custom icons… on separate screen.

Problem appears when i have a list… already filtered list by time/type and etc…
and now if i need to check Multiple category selection
i can’t just add search string in it or something cause i can’t have filter inside already filtered content…

all i need to do is to make with OR all possible filters?
[regular filters that i use for first filtering] and then adding Cat_1_choice = 1 Cat_1_choice=0 , then i do OR … adding again regular filters and do Cat_1_choice=1 Cat_1_choice=1, then i do OR again and regular filters and Cat_1_choice=0 and Cat_1_choice=1 and so on for all possible variants for 9 categories? I’m totally lost here… u all sayin that i can do it, but i can’t understand how :(( sorry for that.

All videos above are working with only one custom filter but not with an idea to filter something out of already filtered list.

Almost it, but i meant something like:

  • (Date, Time) filter
    AND
  • Price filter
    AND
  • Lesson_Cat_1 (always 1) = Loggedin_userchoice_1 (could be 1 or EMPTY)
    AND
  • Lesson_Cat_2 (always 1) = Loggedin_userchoice_2 (could be 1 or EMPTY)
    AND
  • Lesson_Cat_3 (always 1) = Loggedin_userchoice_3 (could be 1 or EMPTY)

AND SO ON…

hmmm…but am i right that if there will be ANDs and i will use only one custom filter for this… i will cover only one possible variantion? and i need to make lots of custom filters with ORs to cover all possible multiselection variants for 9 categories ? in example of 3 categories… if i will make filter 1 0 1 so i will cover only possible variant where user wants to see cat 1 and cat 3…but if he will change it to 1 1 0 i need to have another full filter incl date/time/price and ANDS for categories with 1 1 0… so i need to cover with ORS all variants 0 0 0 , 0 0 1 , 0 1 0, 1 0 0 , 0 1 1 , 1 0 1 , 1 1 0 , 1 1 1 am i right in this logic?

no necessary, the logic is that the filter modifies itself everytime user chage its preferences, for example:

  • (Date, Time) filter
    AND
  • Price filter
    AND
  • Lesson_Cat_1 (1) = Loggedin_userchoice_1 (1)
    AND
  • Lesson_Cat_2 (1) = Loggedin_userchoice_2 (EMPTY)
    AND
  • Lesson_Cat_3 (1) = Loggedin_userchoice_3 (EMPTY)

This means user will see only lesson 1
If user change its filter preferences still work like this…

  • (Date, Time) filter
    AND
  • Price filter
    AND
  • Lesson_Cat_1 (1) = Loggedin_userchoice_1 (EMPTY)
    AND
  • Lesson_Cat_2 (1) = Loggedin_userchoice_2 (1)
    AND
  • Lesson_Cat_3 (1) = Loggedin_userchoice_3 (1)

This means user will see lessons 2 and 3… and so on.

thanks… looks like i beginning to understand… but sometimes i have a problem… if i have property… and by default it’s EMPTY… if i put something into it… i can’t turn it into EMPTY back…
is there a way to put EMPTY there?

update: i see u have sent me lesson about image… thanks.

i did like that :
problem

I have list of sessions that related to event , each event has relation to category_groupping with 9 entries . Each entry has a name, category_number … and every category_number is equal to 1.

I did modal window with toggles…and it works perfect… User database got 18 properties cat_x and cat_x_empty in modal window i do change cat_x to 1 if i turn on and change cat_x to cat_x_empty if off… debuggin text shows it works perfectly…
this screen shows which filter i set up in list … and it doesn’t work :frowning: all what it do right now that if i turn on at least one category - every lesson that has no category_groupping attached disappears from the list and it shows only those that already has category_groupping attached.

But if i change toggles in anyway - nothing changes… all of events with category_groupping attached shows up… and it doesn’t matter which category it is… it just shows up. Where i’m wrong ? :frowning:

Not sure but I bet you are in the right path.
Unfortunately, we reach the point were I can’t help without give it a close look.

You need to make small experiments to discover what part of the logic is failing.

Also, there’s no need to create 18 properties in userdatabase, 9 + 1 is enough because you can reuse 1 cat_empty for all.

I know this logic works because I use it in my PWA.

how does your filter looks? i mean what are you filtering in this list beside search string?

right now i can’t understand how this filter can determine different categories, cause all of them has same value = 1. Or maybe i should make this value from 1 to 9 for each category it should be unique… and change in user properties the same ?

Could you allow clone your app? I can’t figure it out without playing with the alternatives.

This may be missleading because a lesson now has: Lesson_Cat_1, Lesson_Cat_2, Lesson_Cat_3… right?

so Lesson A should have Lesson_Cat_1 (1), Lesson_Cat_2 (empty)… Lesson_Cat_9 (empty)

then, Lesson B should have Lesson_Cat_1 (empty), Lesson_Cat_2 (1)… Lesson_Cat_9 (empty) and so on…

I am trying to help but it’s hard to explain this kind of things when english is not my native language :confused:

Filtering here i did exact same scheme that i have in my app… but just little bit simplier in data… What’s wrong here?

I think i understood that i need to make properties in each Lesson like cat_1_vis cat_2_vis cat_3_vis and depending on category of lesson it will be empty or 1…
for exmaple Sports will be cat_1_vis 1 cat_2_vis empty cat_3_vis empty
Science will be cat_1_vis empty cat_2_vis 1 cat_3_vis empty…

okey i have this in database… so each lesson has all these cat_X_vis properties and only one of them has 1 in it… according to category of lesson…

Now i have filter that it checks if Current_lesson > Cat_1_vis = Logged_in_user > Cat_1
AND
Current_lesson > Cat_2_vis = Logged_in_user > Cat_2
AND
Current_lesson > Cat_3_vis = Logged_in_user > Cat_3

it shows only if ONE category choosed by the user… as soon as i check two of them or three… it does not show anything :frowning: it can’t handle multi choice.
:frowning: Why adalo can’t have Filters as layers… first filter… then among those that we already got from the database i can filter again by another values. :frowning: