This is my first post, so please excuse any faults. I’ve also looked through past posts and didn’t find exactly how to do this.
I’m working on a fairly straightforward search page for a list of items. The search page has a repeating group of items along with a group of search filter components.
On page load, the search filters load a series of basic parameters from the homepage (like airbnb or autotrader.com).
On the search page, I have a slider input to filter search results by price. I’d like this search filter to dynamically populate with the initial search’s max price value.
Here is the search filter logic:
I’ve tried setting the slider input’s max value to the current search results’ max price value but this results in the slider range max value = 0 on page load.
It works fine if I hard code a value like 100,000. I suspect that my logic in the screenshot above causes a loop which prevents results from loading.
Does anyone have any suggestions on how I can set my slider input’s max value to the max of the initial page load results?
One way to address this may be to load the RG first and then run a single calculation to set a max value, instead of using dynamic references on UI elements that continually update and are therefore capable of running in loops. More specifically, you could set a default max value (e.g., 100,000) and then run a workflow once the RG is loaded (or similar) and have it set a new max value based on the data that’s displayed.
Since this workflow is only triggered once the RG is done loading, you don’t have to worry about loops.
How would I go about accomplishing your suggestion above? I tried to find a way to use a workflow to set the slider input’s max value but could not find a way. I’m thinking it should be an Element Action but can’t find one for this specific purpose.
Ok, I think I have a solution. But it’s not I’m that happy with
After putting into words by reply above, I realized that the Repeating Group filter is the culprit breaking everything.
So, I created a duplicate Repeating Group that works off the same search parameters but without the price filter. I then set my initial Repeating Group’s price slider’s max value = to Duplicate Repeating Group’s list of results price max.
It’s not an elegant solution… and can think of at least one major pain moving forward is that as I expand my search and filtering parameters in the future I’m going to have to maintain 2 repeating groups. This is also probably not helping page speed since Bubble has to perform all searches twice. But… it works for now.