Forum Academy Marketplace Showcase Pricing Features

Problem with the creation of a filter

Hello everybody,

I have a problem with the creation of a filter.

I would like the filter to change the data that is display on a repeating groupe.

In order to do that i created a list of several caracteristics with an ionic checkbox on each of them.

I went into the conditional part of the repeating group and i added a condition when each checkbox are checked.

—> le property that i changed was data source

—> and I selected le constraint according to the respected checkbox caracteristic

But the problem is when i check several checkboxes, the result is wrong.

For exemple I have a total of 6 products (3 A, 2 B, 1 C)

When I don’t press any filter i would like nothing to appear.

When I press the checkboxes A and B, I would like to see the 1st 5 product to appear.

Instead of that, when i press A, the 1st 3 product appears and when i press also B, the 3 products A disapears and are replaced by the 2 products B.

Anyone would know how to proceed ??

Thanks for the help.

Best regards.

Vincent

Tough to say, there areally many ways this could be done but without having a link to your editor, it’s tough to diagnose

1 Like

Hello everybody.

I would like to make something like this.

In the page multifilteralist

But the problem is that, in that code, the buttons are in a repeating group and I have a lot of problem to understand all the conditions and the changements of custom states etc…

Is there a way to make something like this but more simpler with just some buttons on the side without display in a repeating group ?

Thanks for the help.

Best regards.

Vincent

I think you want this one ?

https://buildingonbubble.com/block/filter-a-list-with-buttons-1469562701768x293160540320038900

Hello
Thank you for you answer but I think the filter can’t do the same things as this one:

Indeed, I would like that the filter could act exactly like this, with the ability to press differents combinaisons of buttons for a very accurate filter.

I tried to copy the code as much as I can there are still things that i don’t understand.

For exemple, I can’t figure out what is the type of the custom state “selectedColors”

This custom state is mainly used in the workflow of the RepeatingGroup Colour Selector (left)

When i tried to do the same code (I used a custom state of text) i could not find the “:filtered” in the set state value of the event “Text Current cell’s text is clicked and when RepeatingGroup Colour Selector’s selectedColours contains Current cell’s text”

I also coul not find the “:plus item Current cell’s text” in the set state value of the event “Text Current cell’s text is clicked and when RepeatingGroup Colour Selector’s selectedColours doesn’t contains Current cell’s text”

Concerning the RepeatingGroup fruit part

In the data source, I can’t find how to make the filter “colours is in” like in the picture bellow.

If you could help me with this part it would be awesome as it’s exactly the filter that I want.

Best regards

Vincent

I think the best way to help would be for you to share your app. It should work exactly as described.

So can you make it public and share the editor url with me ?

Hello.

Here is the link of the filter part of the app i am trying to build

I tried to copy as much as possible of the following filter:

I would like my filter to behave exactly like this one (the ability to select and unselect caracteristics at wish)

Like I said before I am having troubles to write the exact same code in the “message boxes”

I have the intuition that it may come from the type of the custom state (which is text in my code)

Thanks for the help.

Best regards.

Vincent

Yes, you needed to tick the “is a list” box as we have lots of texts to store.

Then “:plus item” will appear.

Add in the filter on the repeating group and you are good I think.

Thanks for you answer. It’s very helpful.

I can’t believe it was this mighty chekcbox :smile:

I tried a lot of combinaisons except this of course ^^

Well I am sorry to get back at you but I am still having a little problem.

The filter I want to create is divided in 3 categories each of them composed by 5 buttons.

I managed to create the 3 groups (displayed in a repeating group like in the mode I try to copy)

Each one of them are working fine individualy

But when i mix the 3 constraints in the repeating group that display the results (the repeating group of the right), these results does not reflect the expectations.

The things that I noticed is that the filter I built displays some results only if click on a lot of buttons.

For exemple If I want only the results that are from category A even without selecting a number and a month

Do you think that this kind of filter that I am trying to build is manageable through this technique ?

Here is the link of my page of test for the filter (same as the other one but updated)

Thanks

Best regards

Vincent

This ended up being quite complex … so there may well be a better way. However …

What I did was create a new custom state which changes list depending on the values in selected_category, and then I do a search on these two merged together.

If there are no entries in the selected_category state, then this list is all the categories …

If there are one of more, then it is null.

If you did this for all 3 filters … it should work.

3 Likes

It works

Thanks a lot for your time during the week-end

I hope this is the last problem with this thread :slight_smile:

Regards

Vincent

1 Like

Hello,

Nigel you seem to be the man to ask for anything. That is at least what I have discovered flicking through several posts.

I have a very similar issue.

I can filter my results, whcih show up in my repeating group, with one of the filters without any issues.
My issues now:
As soon as I add the other filter, I get no results.
I also seem to be unable to show the results of the filter on a map.

Have you got an idea how to solve this?
You would make my day!

https://perfomingartsnetworkshared.bubbleapps.io/version-test/search-filter-location/sample:custom.locations?debug_mode=true

best,
Sophia

Peeking at your repeating group’s data source, it has a search with these constraints:

Considering that if the value is empty, the constraint is not applied, these constraints are working fine, for Discipline 1 and Type.

Then in the button action shows:

Each row of data has to get a “yes” from each constraint to be included in the search results. The problem here is that once the Type value is not empty, it has to match every tag, which is unlikely. And same for Discipline value.

I can see either of two ways to go forward, depending on how much you like the current data structure:

  1. Use a :filter after the search and have an Advanced constraint something like value is Tag1 or value is Tag2 or value is Tag3

OR

  1. Change the data types so that there is a list of tag texts and a list of discipline texts to match the values with. Then use a :filter after the search to have an Advanced constraint: tags list contains value.

Good luck!

Edit: as for the map locations, simplest way to show the result set is to set it’s data source to be the repeating group’s list of locations.

3 Likes

Thank you, firstly :slight_smile:

I have been trying to apply the ´or´ logic but can´t find a way to tell the constrain that they should be linked by an ´or´ . How do you do this?

As for changing the data type. that makes sense to me, however, it would mean having to restructure all the data inputs and everything around it, so i am trying to avoid it:)

You’re welcome, @sophia.

The normal search constraints focus on one field each. The exception is “any field”, which may actually be appropriate for your situation:
Any field contains Dropdown Filter Type's value

To get a more flexible search constraint, you can use :filtered on the search results. This doesn’t perform as well as constraints within the search, but is fine on a small amount of data.

There you can add constraints similar to the search, but there is an “Advanced” constraint where you can put together whichever values you want to evaluate to yes or no.

Once you have built up an expression that is true or false (yes or no), you can pick “and” or “or”, then put another expression in:

It is a rather well hidden feature!

1 Like

Ah, Thank you so much for this ! great explanation !