Forum Academy Marketplace Showcase Pricing Features

Slider-input dependency

Hi, I am trying to make a slider work with a number input.
I want the sliders value to change when the input field changes, and viceversa (the input’s initial value to change when the slider’s value changes). So far I can only make it work one way but not both of them since I get the error “Circular reference evaluating the input’s initial content”.

Hope you can help me out! Thanks

Create a custom state that has a type of number. On the slider and the input, make the initial value the custom state. Then create two workflows. The first one is when the inputs value changes, set the state of the custom state and reset the inputs. The second one is when the slider value changes, set the state of the custom state and reset the inputs. The custom state becomes the value for both inputs.

2 Likes

Since this topic was ask multiple times. The process @jdiaz described is also working super smoothly, if you want to use buttons / text / icons to change the slider input value and vice versa.

For your icons/buttons/text you just do not need to reset the inputs.

Just create a custom state as number on your sliderinput element. Set the initial content of the sliderinput to your custom states value.

Create a workflow event, which gets triggered, when an inputs value is changed, set the custom state to the sliderinput value and as second step reset all relevent inputs.

For the icons/buttons/texts you want to click, you just increase/decrease the slider input custom state value.

Hope this helps everyone, who was searching how to solve these dependencies.