Multiple filter popup to filter repeating group display [solved]

i have a multiple input to capture as filter to my display. the input for my filter is in popup form. however, i can only filter the right way if i only put one input. if i put more than 1, it wont filter my display according to the multiple input that i key in to filter. as fir now i am using a condition method to filter but it is not working

this is the display

this is the popup to filter my display

this is the current method that im using to filter my display.

is there any solution to this???

1 Like

what im trying to do here is to make my display all the filter that i key in on the popup at once. multi filter.

@fayewatson can you help me out?

Hi @acap :slight_smile: Just to double-check, four of those filters are referring to Max Price, Seller, Distance, Date – what are the other two? And the filters you need can only be dropdowns or you might use inputs and range elements as well?

*Also, what are the sorting options?

You don’t need a condition for every value in the dropdown. You simply USE THE DROPDOWN’s value in your search expression.

Just as you would do with any other input.

@fayewatson its date and type. the max price and distance is in number format and date is in date format

harga max = max price (number)
orang sebilik = people / room (text because no calculation needed. just display)
penerbangang = airline (text)
jarak maximum - max distance (number)
tarikh = date (date)
jenis umrah = type (text)

@keith but i want the repeating cell to show all the data if there is no value in those drop down. what do u mean by search expression?

Click the box for “ignore empty constraints”. Now instead of matching “null”, your search will disregard the constraint and show all values.

As for what a search expression is… THIS is a search expression (circled in red):

You have a separate condition for each and every value of the dropdown. This makes no sense. What you want to do is simply have ONE search expression and move the value of the dropdown to the constraint. Like so:

@keith ive tried doing that. the reason is the dropdown value is a static choice. hence, cant be read as number. and for the last choice in max harga’s dropdown value is above 16,000.

ive created database for those choices so that i can use a dynamic choice. but i cant figure-out the above 16,000 part with this method.

this is the choice:

5000
6000
7000
8000
9000
10,000
12,000
15,000
Above 16,000

@acap Is this example along the lines of what you trying to set up?

Preview:

Editor:

If so, there is just a minor workaround for the Max Price dropdown. The dropdown that the User sees is setup in the way you have it:

Since the last option contains a text “Above 16,000”, we can use a transparent input which removes that text when filtering the results. In the corner of the popup there is an element called “Input Max Price (Transparent)”:

*The transparent input’s value is “Dropdown Max Price”'s value:find&replace (the find and replace part removes the “Above” text, so the transparent input only contains 16,000 when that option is selected).
Edit: After reading Keith’s post, I realize that this should instead replace"Above 16,000" to empty, since Above 16,000 equals “No Max Price”. This way, the Max Price constraint will be ignored if the User selects “No Max Price”

This way, the repeating group just uses the Number value from the transparent input:

The last option makes sure that the repeating group sort changes. By default, the items are sorted by “Date”:

Then there is one conditional statement which sorts the results by Type when the Dropdown Sort By value is “Type”:

As @keith stated, you’ll want to select ‘Ignore Empty Constraints’ for the data searches. This is because the User may not fill out all of the filter options. For the options they don’t select a filter for, Bubble will ‘ignore’ that constraint/filter. :slight_smile:

1 Like

You were very close to having that all figured out! You just need to make your database object a little bit fancier… Read on:

There are two things you should do here. First, as you point out, not all of your dropdown choices are numeric. So, instead of having a list of mixed type in your database (which of course you can’t have), you create a custom object, like:

Harga Dropdown Option

A Harga Dropdown Option should have TWO fields on it: The Displayed Caption (data type text) and Value (data type number).

Now you can either make a new data type called Harga Dropdown OptionS (see what I did there?) and give it a field that is of type Harga Dropdown Option (and make that a list), or just “Do a search for… Harga Dropdown Option” and sort them the right way (sort on Value, ascending) to get your dynamic dropdown source.

Now your dropdown selects a thing of Harga Dropdown Option type. What a weird thing to select, right? It’s neither a text nor a number. It’s just a Harga Dropdown Option. BUT, the Harga Dropdown Option’s Caption is a text. And the Harga Dropdown Option’s Value is a number. Cool!

So now…

For the dropdown’s caption field, just use Harga Dropdown Option's Caption. The numeric value associated with that selected object is now the Harga Dropdown Option's Value (and that’s what you’d use in your Search constraint).

Now, the second thing:

[Edit: Removed confusing sentence.] If I’m not mistaken, when “Above 16,000” is selected, that’s the same thing as not having a constraint, right? So you can make THAT Harga Dropdown Option’s Value field nothing (empty, which is the null value in Bubble).

1 Like

so just to make it clear, i should use constraint on package data source on the repeating group and constraint it base on the values of the dropdown on filter popup instead of using conditional? I’ll give it a try and will update both of u wonderful people!

1 Like

@acap Right! :slight_smile: Instead of listing each possible dropdown value as a conditional statement, you can use the inputs’ values in the constraint, and Bubble will automatically update the results that match the constraints/input values:

For example, if the User selected “JetBlue” as the Airline, and Max Price = 5,000, the constraints would dynamically become “Airline = Dropdown Airline’s value [JetBlue]” and “Price < Input Max Price (Transparent)'s value [5,000]” automatically.

Bubble would show all Packages with the JetBlue airline, below 5,000. :slight_smile:

1 Like

^^^ Yep.

(Though note that I would do the dropdown part differently than Faye did – it’s very clever to pass the text dropdown to another input for conversion, but why do that when you can just construct your dropdown options properly in the first place?

I would argue that my solution is more “Bubble-like” - it takes advantage of the flexible data structures in Bubble, more performant, AND easier to maintain… Note that you can change the dropdown values at any time, either programmatically or manually, without even having to update the app. Simply modifying the Harga Dropdown Values in your database will magically make the dropdown change.)

IT WORKED!!! i’ve spent the whole day yesterday trying to figure this out. thank you so much!!! will let you know if there is any problem in the future if thats alright :stuck_out_tongue:

3 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.