Code Expression Giving Error Message "Variable Not Valid"

Hi!

I am trying to add a code expression "value / 700 (the max value for the slider widget)" to a Slider widget so that whatever value the user chooses (on a scale of 1-700) on said Slider widget will be converted into a decimal/double between 0 & 1 so that it can be displayed on a Progress Bar widget (which of course can only accept inputs between zero and one), when the user clicks the "Submit" button.

The action flow I'm aiming for would be something like this: 1. User slides the Slider widget to desired value 1-700. Code Expression converts that value to a number 0-1. The new widget state value is set equal to the App State "sliderValueDecimal." (a type double of course) 2. User taps the "Submit" button, the Progress Bar widget would be set to equal the app state variable sliderValueDecimal, which had just been set to equal the widget state value of the Slider widget.

Further, I've never coded but I also tried to create a function to accomplish the same thing. If someone could please tell me how I would modify that function that would be an unexpected bonus and sincerely appreciated as well!



Thank you.

1
11 replies