Can I dynamically modify max value of a slider?

I have a basic slider element that shows different versions of an image, based on data. Works fine. But I have to ‘hard-code’ the max value in advance, rather than having that value come from the database along with the info.
Example: each row in the db contains a list of images that the slider is ‘sliding’ through (slider value “1” is showing item#1, slider value “5” is showing item #5, etc.)
But I want the slider to adjust based on the number of images in that row (or even a number field in that row). For example, if one row has only THREE images instead of five, I want the slider to show the end of the slider as 3 instead of the ‘hard-coded’ 5.
Apologies for this if it’s super basic… I’m a newbie, and not at all sure how / where / If I can modify these elements with CSS and/or JS and if so, where that code would even GO in Bubble.

I believe you can (assuming you’re using the standard Bubble slider input):

So you can just set a condition to set the Max value to what you want.

1 Like

OMG I feel like an idiot :woman_facepalming:
Guess I just learned to look at the Conditional tab more often…
Thank-you SO MUCH. :pray:

I’ve been using Bubble for about a year and I STILL forget about a lot of stuff.

1 Like