You are on page 1of 5

Variables Page 1 of 5

Variables

Types of Variables

How to use Variables?

Reading Variables from a Text File

Other
user
resources:

Variables in Automation Anywhere Client


Automation Anywhere Client provides powerful options for creating and using variables in tasks. A variable is simply a “holder”
that you can assign a value to. Using variables in tasks lets you run the same task repeatedly with different values, without re-
recording tasks.

Manage your variables with the following options:

Create New Variable


To create new variables, click the Variable Manager icon in the Task Editor . Automation Anywhere Client provides
predefined variables, called System Variables. You can also create your own variables and optionally assign their values.
You can then add these variables to any number of tasks.
Automation Anywhere Client can create three types of variables:
List (Multiple Values): With variables of the List type, you can assign multiple values to a single variable. List variables
are very useful when you use them inside the Loops command. For example, you can assign 10 different product names to
a single list variable and place the variable inside a Loop command. Then, each time the Loop runs, it reads and applies
the next variable in the list. Alternatively, you can use the variables in your list to loop in a random manner by using the
Make Random option.
Value (Single Value): A Value type variable can hold text data. For example, you can assign your email address to an
email variable. Example: email=contact@automationanywhere.com. You can also read data from a text file and assign it to
a variable.
Random (Random Value): You can define Random type variables to hold two types of values: a string or a number.
For a Random variable of type String, Automation Anywhere Client will generate a random string value of a length you
specify. For a Random variable of type Number, Automation Anywhere Client will generate a random number within a
range you specify. The values for Random variables are generated at the time the task runs.

file:///C:/Users/AKASH/AppData/Local/Temp/~hh6328.htm 14/08/2017
Variables Page 2 of 5

Select Variable from List:


With this command, exisiting Automation Anywhere Client users can select variables from their variable list. Simply select
this action to view your list of pre-exisiting variables. Select the check box options to choose the required variable(s). You
can then use these variables in your task.

System Variables:

Automation Anywhere Client provides predefined variables, called System Variables. The description for each system

file:///C:/Users/AKASH/AppData/Local/Temp/~hh6328.htm 14/08/2017
Variables Page 3 of 5

variable is provided for easy understanding and enables quick implementation by the user.

Other
user
resources:

How can I use variables?


You can use variables in many actions, e.g., Keystrokes, Open Programs/Files, Files/Folders, Insert Prompt, etc. Automation
Anywhere Client always formats variables between “$” signs, e.g., $Your-Variable$.
The $ sign before and after the variable name tells Automation Anywhere Client to treat the text between the $ signs as a
variable, and not as plain text. When the task runs, Automation Anywhere Client replaces the variable name with the actual
value of the variable.

The following screenshot illustrates how to insert a variable with the Keystroke
Action.

file:///C:/Users/AKASH/AppData/Local/Temp/~hh6328.htm 14/08/2017
Variables Page 4 of 5

Other
user
resources:

Reading variables from a text file


Automation Anywhere Client lets you define the values of your variables in an external text file.

Follow these options to read variables:

You can declare the variable as a Value or List type variable using the Variable Manager.
If you don’t want to specify the value of the variable at the time you create the variable, but you want the task to
read the values from the text file, you can select the option “Read from text file.”
When the task runs and comes to the variable, it reads the value of the variable from the file you specified in the
Variable Manager.

file:///C:/Users/AKASH/AppData/Local/Temp/~hh6328.htm 14/08/2017
Variables Page 5 of 5

Follow these guidelines to format the text file so that Automation Anywhere Client will successfully read
the values of the variables:
One text file can have multiple <variable>=<value> pairs in different lines, separated by the ENTER key.
If the variable is a Value type, it should have only one value, for example “myvar=value1” (without quotes) where
myvar is the name of the variable you defined in Automation Anywhere Client.
When the task runs and comes to the variable, it reads the value of the variable from the file you specified in the
Variable Manager.
If it is a List type variable, you can define the comma-separated values for the variable, for example my-list-var
=value1,value2,value3.
Variable names are not case-sensitive.

Following is an example of a text file with different <variable>=<value> pairs:


Age=12,13,16,21
Games=Football,Soccer,Rugby
username=my-username
password=my-password

Other
user
resources:

file:///C:/Users/AKASH/AppData/Local/Temp/~hh6328.htm 14/08/2017

You might also like