Reset all variables assignement

code
bestpractices
improve

#1

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


#2

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)


#3

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.


#4

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: