Reset all variables assignement

Hi team,

i would like to know if there is a quick way to reset all my variable at the end of my workflow ?
I work with around thirty differents varaibles (most of it are string and boolean) and my all workflow is looping to start. I would like to be sure that all the boolean (assignement in try-catch) are false before to go througth the sequence and the Flow -decision based on it .

Regards,
Bastien

Hi @bmuto,

Actually there isn’t an activity or even a .NET code that could achieve this result as far as I know, but I would suggest you to create an array of variables of the same type and whenever you need to reset them you could do it by assigning this array variable to a New Array of the type needed. I have attached an example. Therefore, whenever you are going to use those variables, you just have to pass the index.

Main.xaml (6.8 KB)

1 Like

I understand that It is difficult or maybe impossible to reset all the variables but I t could be a great idea to searching for variables in all the project.

2 Likes

Thank you for your advise and example. I will work on this array of variable, at least it avoids to go through 30 new assign activities !

@Lucky0906 i agree with you, a “reset all” activity would be perfect :slight_smile:

1 Like

Even if this thread is old, its unsolved till now.

I’d recommend to use the multiple assign activity and input all the variables in there once and set them to nothing or false.

Advantages to the solution with the array:

  1. It’s shorter
  2. It’s easier
  3. Its shown more clearly and so its very easy to adjust. Through differentiating between setting variables to nothing or false you will have an easy and quick overview about what types you variables are without going to the variables panel.
  4. you are able to copy paste just one activity instead of 3 neccessary activities shown above.