The Create Variable action is used to create a variable that can then be used in other task steps to store changeable values.
From the Task Builder Available Actions pane, open the Variables folder and double-click the Create Variable action or drag it into the Steps pane.
In the Variable Name box, enter a name for the variable. Be sure the name is unique and does not conflict with any BASIC scripting keywords such as date, day, week, etc. One safe way to do this is to always include identifying characters, such as VAR, in variable names (for example, DateVar).
If you want to give the variable an initial value, enter it in the Initial Value box. You can enter a literal value or click the Insert Expression/Variable button and use the Expression Builder to enter an expression.
If you want to include a description for the variable, enter it in the Description box. The description will be displayed in the Variables tab of the Task Builder debug window.
To specify additional properties, click the Advanced tab and enter the properties as follows:
In the Variable type box, select from the following:
Auto: AutoMate will auto-detect whether the variable contains a number or text. The variable will adapt to the proper type when possible depending on the operation being performed.
Text: The variable will always be treated as text regardless of its contents. An error will be generated if an operation is attempted that is only valid for numbers.
Number: The variable will always be treated as a number regardless of its contents. An error will be generated if an operation is attempted that is only valid for text.
Select the desired check boxes:
Variable is read only: The variable cannot be set to any value other than the initial value.
Variable is private: The variable is available only to the current task, and not to any sub-tasks.
Variable is parameter: The variable will only be created if it does not already exist. This can be used when building a sub-task, for example, in cases where the variable will be created by the parent task at run time. This allows you to create and test the variable while building the sub-task.
Disguise initial value: The initial value displays as random characters in the AML file.
To set the Description tab properties, refer to Description Tab Options.
To set the Error Causes and On Error tab properties, refer to Step Error Handling.
When finished, click OK to save settings and close the properties dialog window.
Adding Task Steps
Create Variable Action