Resetting all variables from project

Hello,

is there a way to reset all the variables from the project easily?

Use case: We have a pretty complex project that has grown over time. We use the editor to test and debug the application, however, we need a fast way to bring the whole application to an “empty” state, to simulate that a user is interacting with the application for the first time.

Right now we have a workflow to reset all variables, but this needs to be updated every time a new variable is created. Having multiple people working on a project, this is unsustainable. Also resetting all local storage kicks you out of the session, which is always a bummer and time consuming.

Is there a way to do this better? I remember seeing that all variables are contained within an array when I access them on javascript. Is it possible to somehow “reset” this array on JS?

Thanks!

1 Like

I’m gonna link this here

I think this starts to sound like a feature request @Joyce

1 Like

Hehe I encourage you to post it here to help the tech team prioritize it :slight_smile:

The team has it in mind but it’s not on the roadmap yet.

2 Likes

Also adding here…

When trying to reset variables, if variable is now ‘undefined’ it shouldn’t throw an error and terminate the rest of the workflow actions.

I’ve ran into this where I’ve either deleted a variable to clean up, or, when the workflow is duplicated across components but some of the variables in one workflow aren’t visible due to conditional rendering.

‘Reset variables value’ action should execute all visible variables and continue processing the next action.

image

Feature request made. Hopefully this gets some attention. Also any workaround manipulating the inner workings of weweb would be highly appreciated.

I know that there is an array with all variables, that could be iterated so that variables are reset. Does anyone know if there is a similar array to the one holding the current variable values, but containing instead the initial value? This way handling this in JS would be easy.

Furthermore, I completely agree with the post above. This makes the resetting of variables very hard to maintain.

1 Like

Hi @avd,

I try to understand why you would need to reset all your application variables. Normally, each time a user comes to the application, it should have the default values, unless you toggle the local storage option on.

Can you give us more details?

1 Like

Hi @flo ,

I won’t answer your question about all variables, but resetting all controls on the form at once would be nice :slight_smile: