Read and Review Automation Anywhere Documentation

Automation Anywhere Version 11.3

Close Contents

Contents

Open Contents

Reading Variables from an External File

  • Updated: 5/06/2020
    • 11.3.x
    • Explore
    • Enterprise

Reading Variables from an External File

If you do not want to specify the value of the variable at the time you create the variable, Automation Anywhere allows you to set the values of variables using an external file such as CSV, Excel, text, and database.

Reading from a Text File

To read variable values from a text file, follow these steps:

  1. In the Variable Manager, click the Add button at bottom or right-click on an existing variable and select Add to invoke the Add Variable window.

    Note: In the Add Variable window, the Create New Variable option is selected by default.
  2. Select the desired variable type, enter a name, and select the 'Read from Text File' option from the dropdown.

    To ensure that Automation Anywhere reads text files properly when assigning values for the variables, follow these guidelines:

  • One text file can have multiple<variable> = <value>pairs, on separate lines (line returns using the ENTER key).
  • For value type variables, only one value should be assigned.
  • Example:myvar=value1wheremyvaris the name of the variable.
  • Example:my-list-var= value1,value2,value3
  • Ensure that your text file is specified in the Variable Manager before the task runs.
  • For List type variables, you can define the comma-separated values for the variable.
  • Variable names are not case-sensitive.

Example: Text file with different <variable>=<value> pairs:

Age=12,13,16,21

Games=Football,Soccer,Rugby

username=my-username

Removed the password field.

Reading from an Excel File

When you create an array variable and specify that values should be read from an Excel file, data can be read for the following:

  • For an entire row
  • For an entire column
  • For a range of cells that you specify using the 'From' and 'To' fields

Reading from a Database

To read values from a database file, you need to specify a connection string and a SELECT query.

Note: Reading variable from database is applicable only for array type variables.
Send Feedback