Hi guys I had a question on how this is best done. Lets say I have 8-20 variables that are used throughout a bot process to either hold or extract data and each time the bot goes through a loop I need those variables initialized to their original state.
Is there a better way to do this other than using assign functions to set each variable back to “”? Or does Uipath initialize them automatically upon each loop? Thanks.
The bot does not automatically assign it to the original state… but you can use different approaches like this…
Use multiple assign activity to assign all the variables to its original value in one assign activity.
If the variables are used only inside the loop, Set the scope of the variable to the body of the loop activity. In this, that sequence will execute multiple times and each time new item is processed the variables will get initialized to its default value.
There is a multiple assign activity which allows you to assign multiple variables in one go. However if you are using a older version this might not be there… in that case you will need to use the assign activity which you are already familiar with