Advanced filtering on RG

I am trying to build a filter / search page within my app and have hit a block. I have seen there is a few different threads on this subject within the forum but I’m not having any luck replicating within my app and the way I want to filter my data is also slightly different.

How my database is set up:
I have a data type ‘User Trip’. Under within this data type, the user trip can contain a Type (data type Type) and list of Colours (data type Colour) per below:

Screenshot 2020-10-13 at 07.48.41
Screenshot 2020-10-13 at 07.49.24

The User trip can have a list of colours, but can only have one Type.

I have manually added the colours and types in my database per below:

The user Trip also contains a destination (text field) and dates (to and from)
Screenshot 2020-10-13 at 07.55.03

What I want to achieve:
On my filter page, I have a RG which lists all user trips. I want to be able to filter by Destination via an input form, which I did manage to get working using a fuzzy search plugin, but I also need to filter by dates and using checkboxes in an advanced filter like below:

Users should be able to select as many of the checkboxes necessary.

What I have set up so far:
I have set up custom states on the parent group of the RG which I understand is the best approach as I may need to also add additional filters in future.
Screenshot 2020-10-13 at 08.02.28

I am having issues setting up the workflows on the checkboxes, more specifically, adding the values for the custom states in my workflows.
I am also unable to filter the RG applicable to my custom states, despite trying several different ways.

If anyone is able to point me in the right direction, or even let me know if what I am trying to do is achievable it would be much appreciated.

To add further detail, I am attempting to set the state of the parent group to the value ‘red’ when a user clicks on the red checkbox.

From my understanding of custom states, given that this custom state is type ‘colour’, I should ultimately be able to set the state to this value. I am trying to trigger this workflow but it doesn’t seem to allow.

I am still learning bubble and this is my first time using custom states that are not text states.


so I think you make it more complicated that it has to be

Whenever user picks some filter just change the state e.g. if the user picks red → make changes to the state Colors: Value: This state + plus item “Red”

Do the same with other filters you have (date, type etc)

Now you do filtering based on those states in the RG itself

So you have to create conditionals on every possible search filter

  1. when Group search colors count is not 0 and “Data start” is empty
  2. hen Group search colors count is not 0 and “Data start” is not empty

You could also make a button “search” that would apply all the state when the user clicks - but its your UX choice.

PS. I would create icon that acts like a check box - much more flexibility imo :slight_smile:

I grappled with similar questions and eventually found the answers. To add to the above, a few things which may help…

This video from @romanmg explains how to do it:

Additionally, looks like your colors filter involves filtering a list with a list which is a special type of search. This requires using an advanced filter which is client side. Note this will be slower to process on a large dataset. Below posts go into it…

1 Like

Depends, if she’s only filtering results from another RG it should not make the process slower.

If the search will be done every time the filtering conditions are changed, that is true


Another tip: if you plan to use “merged with” you will have to make another RG with data search.

In a condition like this: RG's list of things: merged with: RG'list of things:filtered

Bubble will:

  1. give you list of things from first data set
  2. that list will be merged with results from second data set
  3. at the end everything will be filtered ((so first data set + second data set):filtered))

So in reality this condition works like this: (RG's list of things: merged with: RG'list of things):filtered

I hope it makes sense

Hey, thanks for the help and for replicating this to show me how to set it up. I’m not sure what I’m missing but I Bubble doesn’t seem to like when I try to set the colour state’s value to plus item ‘Red’.

I thought that this should be available in the drop down when I try to ‘plus item’ but I suspect this is how I have my database set up.

Each colour is entered into the database manually per below as a colour ‘name’.
Screenshot 2020-10-13 at 19.35.31

Then I added them manually.

When a user creates a user trip, the can select a list of colours:
Screenshot 2020-10-13 at 19.37.08

I feel like I am doing something wrong which should be glaringly obvious, but if I am setting a colour state, should the list of colour ‘names’ not be available to set in my workflow or does my database need to be re-configured?

Your database set up is fine. You could also use Option Sets for this, but you don’t have to.

I am pretty sure you made a mistake and the state isn’t a list or you changed the state to be listed of texts but it should be a List of Colours. Please check it again

Is this the same element?

Yep, it is set up the same way. I actually tried to troubleshoot a few different ways by seeing if it would work on a text state, and also setting up a state on the actual RG itself instead of the parent group but it didn’t work.

I’ll have another look now and try figure out what I am doing wrong in that case. I’m sure I’ll have an ‘Ah ha’ moment soon…

Hmm maybe it has sth to do with the element that is connected to the workflow

I can’t do it with the checkbox but I can with the repeating group

I would recommend you build a RG with icons acting like checkboxes and ditch the Checkbox element

I see what you mean now, so in effect I need to set up my ‘filter bar’ as a RG with each data type, similar to the video that @ed727 linked in the thread.

Okay, I’ll try this out and see how it goes.

yup :slight_smile:

ps you can’t use :plus item with this action