Help files

Persistent Variables

What Persistent Variables are and why do I need them?

When you are creating a Process with WinAutomation, you may sometimes want to keep the value of a specific variable available for the future executions of the Process. Persistent Variables allow you to do exactly that: keep a variable’s value available for the next time that the Process executes.

Before this feature was available, the standard way to keep values was to store them into external files, a process which sometimes could be complicated. Now by simply marking a variable as persistent we can be sure that its value will be kept between the executions of the Process.You can set a variable as persistent through the Tools Menu option > Variables Manager window while in the Process Designer.

persistent1.png

If the variable that you want to make persistent already exists, you can just select it in the “User Defined Variables” tab and then hit the “Edit Variable” option. If you want to create a brand new variable and make it persistent, click on the "Add New Variable" button.

persistent2.png

In the new dialog box, you will have to enter a name for the new variable and check the “Variable is Persistent” option.

persistent3.png

When you first create the persistent variable it will not have any stored value. However, if you run the Process and give the variable a specific value, you will be able to see the currently stored value from the “Edit Variable” window in the Process Designer’s Variable Manager.

Persistent Variables in Compiled Processes

If you compile a Process that includes persistent variables, there will still be persistent variables available in the compiled executable, but the stored values will be reset.

The values of persistent variables, after a compiled Process has been executed for the first time, are stored in a file that is located in the same directory with the compiled Process and is named according to the following notation:

CompiledProcessName.config

So if, for example, you have a compiled Process named: UploadFolder.exe, the persistent variables will be stored in a file named UploadFolder.config that is located in the same directory with UploadFolder.exe.

Notice, that the current value of a compiled Process’s persistent variable can be read if you open the .config file with a simple text editor (e.g. notepad). However, in some cases, you may want to store sensitive data, like passwords, in a persistent variable. In this case, you will have to select the “Encrypt Persistent Variables” checkbox in the “Misc Options” tab of the “Compile Process” dialog.

Persistent_Variables_Image_1.png

This way, all the values from the persistent variables will be encrypted in the .config file.