I’m stuck. I’m using a sliding bar to show a percentage between 0 and 100. The text box below it on the left is showing the value of the slider. I would like the text box below it on the right to show the corresponding difference. For example, when the box on the left shows 85, the box on the right will show 15. I’m new to Bubble and my mind is Excel-centered. It seems like it should be such a simple formula of “=100-SliderInputA’s value”, but of course that does not work. I even tried creating a hidden text box with a set value of 100 and using that as the lead in the formula, but that also did not work. Any ideas?
You’re on the right track with the formula approach! In Bubble, the key is to make sure you’re using dynamic expressions properly. Here’s a solution to achieve what you want:
- Slider: You already have a slider element that ranges from 0 to 100.
- Text Box for Left Value: This text box shows the value of the slider (SliderInputA’s value).
- Text Box for Right Value: To show the difference, you can use this formula:
- Set the text in the right box to: 100 - SliderInputA’s value.
In Bubble, when you want to perform calculations using dynamic data, just enter the expression directly in the text box. It should look like this in the right text box:
100 - SliderInputA’s value
Make sure you don’t need quotation marks or a static number like 100 in a different format. Just type it directly as Bubble understands this type of operation.
This will update the right text box with the difference between 100 and the current value of the slider.
This topic was automatically closed after 70 days. New replies are no longer allowed.