Good evening all,
I am practicing the Search and filters in Repeating groups. I have created a check box and an input text box, and what I would like to achieve is to combine both filters on the list of Users that I have.
I have managed to achieve what I want, by using this basic repetitive logic
When the checkbox is checked → Data Source- > Search For users → Filtered with the contraints.
When the Input’s Box value is not empty → DataSource-> Search For users . filtered…
When Input Box AND Checkbox are checked and input is not empety → Data Source → Search For Users - filtered with both contraints.
My question is : Is there any better logic or way in order to achieve the same result? As I was wondering : What if I had 20 checkboxes or input boxes? I had to create multiple permutation of all checkboxes/inputs box otherwise…
Thank you for your reply. But the problem that I have is a bit different, Even if i tick the ignore empty contraints,
when i Use at the same time the checkbox and the input box, the filters are not going to work properly, the reason is because everytime the conditions applies I do a new “Search for” .
For instance : I have a list of users with a certain age and number of children.
User1 35years 1 child
User2 20 years 2 children
User3 40 years 2 children
The checkbox is Above30 years. So when I tick it, it should display only the users above 30 years old.
The inputbox is related to the numbers of children.
If use the filters independently , it Works. But If combine both filters doesnt.
I.E using the checkbox and typing 2 on the children input box
the only result i should have is the USER3.
Instead is giving me User2 and User3, because is doing a “new” search for.
If I Combine both filters and ignoring the empty contraints, I have a different issue.
If I deselect the checkbox, and I type now the number of the Children, is not gonna do anything because the condition to be respected will be:
“When the checkbox is checked” → Do search for → filtered Age and InputBox
I dont know If I have explained properly and I apologise if thats the case.
Yes It works like that, But now what if you try to DESELECT the checkbox and type the Children number?
It wont respect the condition so it wont filter.
So basically I want those filters to be combined anytime , selecting or deselecting the checkbox, and typing or not typing any children number.
And thank you for your reply and help.!
Yes correct, thats what I have written at the beginning. But I was wondering if there is an easier way/ logic by interpolating the filters/ or the searches.
As the question now is , what if you have 30 checkboxes and 5 input field search??
Thank you for your help and contribute
Ah, I’ve totally missed the point and was thinking you couldn’t achieve this behaviour
So if you are going to have 30 unrelated checkboxes that would be a tough job to keep things organised. You can check “daisy chain” filtering method mentioned by @romanmg, I think it’s more convenient in your case:
Thank you , you have been very kind,
Would you also please be so kind to help me in finding some articles about the real difference between:
search User : Filtered
and Filtered using the constraints when doing a search for.
Thank you very much
*Using advanced filters can slow queries down - An underlying principle is that if a filter (or sort) can be done “on the database”, it will be faster than a filter (or sort) that Bubble has to do after retrieving an initial set of data from the database. Which filters are done on the database vs. not? Filters which show up in the Search palette (the additional sidebar which slides out when you click “Do a search for”) are done on the database and are thus are generally fast. Filters which are applied with :filter are generally “advanced” filters that are generally slower.
Hi, thank you for your support and help.
Apologies for the late reply, as i was working all day.
I have checked what you published and unfortunately it doesn seem to work as I wished.
But thank you for your time!