Is it possible to edit a Temporary State and save the change

Let's say I have a temp state "Limit".
Now, I build a slider component to change the value of temp state Limit.

I set the default value for the temp state to be {{slider.value}}
and for the slider, I set the default value to {{Limit.value}}

Essentially what I am trying to do here is,
Save the change that I made using the slider in the temp state.

This gives me a dependency cycle found error.

If I give a temp state a certain default value, in our case let's say 10,
Every time I start that retool app, it will be initialized with the value 10.

I want to have the ability to edit this temp state's value and essentially save it, for example,
If I use the slider to raise the value of our temp state Limit to 12; the next time when I open the retool app, the default value for the temp state Limit should be 12.

Is it possible to achieve this with this method or by any other method perhaps?

If you want the value to persist between sessions or loading of the app then you should use localStorage not temporary state. Temporary state is, well, temporary. Local storage retains it in your browser so will be available when you reload the app.
If you want to persist the value between users (so everyone who opens the app has the same default value) then you need to store that in a database or some other persistent storage.

As for the component, if you set the default value to {{localStorage.values.slider_value}} and have a change event handler to set local storage of slider_value to {{slider1.value}} it should work as you described.

simple example:
forum.json (5.8 KB)