Forum Documentation Showcase Pricing Learn more

Storing filtered Repeating groups


#1

Hi, I have a repeating group with filters. I use the Multidropdown together with a filter button. When a user presses the filter button it saves a custom state which intersects with the search filtered. At the end of workflow I display the filtered list on the RG. The issue is that users are complaining that when they go to another page (through the RG) and they hit back they are losing the filters. Is there a way to make the filter stay?


#2

When you want to preserve a search for the sake of navigation, it’s best to use URL parameters that update with your search.

Take a look at a search on the Bubble forum.

  1. I start at forum.bubble.is, then I enter a search in the search bar (say “repeating group”)
  2. The URL now becomes https://forum.bubble.is/search?q=%22repeating%20group%22
  3. I click on the first result, and now I’m taken to the page,
    https://forum.bubble.is/t/search-results-in-a-repeating-group-inside-another-repeating-group/26039"
  4. I decide that post that I looked at wasn’t right, so I navigate back and there are my search results for “repeating group”

Notice in step 2, our URL now contains what’s called a parameter. This parameter is made up of two parts: a key and a value. In this case, “q” is the key and “%22repeating%20group%22” is the value (the extra characters are for URL encoding - certain characters like spaces aren’t handled well by URLs).

The search input on the page references that parameter, “q”, to set the initial content of the search bar. That way, your search is automatically loaded for the user when they hit back (or share) the URL with another user).

You can rinse and repeat this process with many parameters. (Try creating a search on Airbnb and see what happens to the URL as you update parameters).

You “update” the parameters in the URL through a navigation event. (Navigate to the same page, but specify the parameters being updated within the URL).


Dan (creator of LearnTo - 15+ hours of Bubble tutorials and live coaching)


#3

How am I able to do that using links from RGs please?


#4

Could you clarify your question? Need for you to provide more than that to give a helpful response.


#5

Hi @dan1, yes of course.

My current filtering workflow is as follows:

I first add a state with no filters called FILTER:

I then Intersect the custom state with a search which has been constrained to an input (this only happens if it’s not empty):

Last but not least I display list in the repeating group:

These are my filtering options:

When you click the Filter button there’s no URL Parameter.


#6

Think of it this way:

  • A state is setting a data value somewhere on the page via a Set State action.
  • A parameter is storing a data value in the URL of the application using a “Go to page” event.

Given that your workflow is built of a series of set state actions (and one display data action), there is nothing there that updates the URL.

If you wanted to use parameters, your last step in your workflow (when the button “Filter” is clicked), should be a go to page event, specifying unique parameters for each of the inputs that you want to have auto-filled. (For those inputs, within their initial content section, they should have corresponding “get data from page URL” actions associated).


#7

@dan1 Managed to make it work with text input but not with multidropdown because they are set as a type which is not text. Is there a way where the parameter stored in the URL is not a text?