Read and Review Automation Anywhere Documentation

Automation Anywhere Version 11.3

Close Contents

Contents

Open Contents

Array variable with Loop command

  • Updated: 4/17/2020
    • 11.3.x
    • Explore
    • Enterprise

Array variable with Loop command

After array type variables are created, you can process them in automated tasks using the Loop command.

Using the direct assignment array variable

  1. Open the Workbench.
  2. Create an array variable, for example $Student_Data$, using the Direct Assignment option from the Variable Manager.
  3. Drag the Loop command and select the Times option.
  4. Press F2 to insert the $ArrayRow$ variable and select the Array Variable as $Student_Data$.
  5. Create a value variable using the Variable Manager, for example $row$, to iterate through the number of rows.
  6. In the Loop command, perform these steps:
    1. Drag the Variable Operation command, select $row$ in the Specify Variable drop-down list, and press F2 to select the $Counter$ variable in Specify value.
    2. Drag another Loop command and select the Times option.
    3. Press F2 to insert the $ArrayColumn$ variable and select $Student_Data$ as the Array Variable.
    4. Drag the Message Box command and press F2 to insert the $Student_Data$ variable.
    5. In the Array variable dialog box, press F2 to select the $row$ variable in Row Value and the $Counter$ variable in Column Value.
    6. Click OK to save the values and click Save to save the message.
  7. Click Run to run the TaskBot.

Using the read from text file array variable

  1. Open the Workbench.
  2. Create an array variable, for example $Sports_team$, using the Text File Assignment option from the Variable Manager.
  3. Drag the Loop command and select the Times option.
  4. Press F2 to insert the $ArrayRow$ variable and select the Array Variable as $Sports_team$.
  5. Create a value variable using the Variable Manager, for example $row$, to iterate through the number of rows.
  6. In the Loop command, perform these steps:
    1. Drag the Variable Operation command, select $row$ in the Specify Variable drop-down list, and press F2 to select the $Counter$ variable in Specify value.
    2. Drag another Loop command and select the Times option.
    3. Press F2 to insert the $ArrayColumn$ variable and select $Sports_team$ as the Array Variable.
    4. Drag the Message Box command and press F2 to insert the $Sports_team$ variable.
    5. In the Array variable dialog box, press F2 to select the $row$ variable in Row Value and the $Counter$ variable in Column Value.
    6. Click OK to save the values and click Save to save the message.
  7. Click Run to run the TaskBot.

Using the read from CSV/Excel array variable

  1. Open the Workbench.
  2. Create an array variable, for example $Employee_Data$, using the Excel or CSV File Assignment option from the Variable Manager.
  3. Drag the Loop command and select the Times option.
  4. Press F2 to insert the $ArrayRow$ variable and select the Array Variable as $Employee_Data$.
  5. Create a value variable using the Variable Manager, for example $row$, to iterate through the number of rows.
  6. In the Loop command, perform these steps:
    1. Drag the Variable Operation command, select $row$ in the Specify Variable drop-down list, and press F2 to select the $Counter$ variable in Specify value.
    2. Drag another Loop command and select the Times option.
    3. Press F2 to insert the $ArrayColumn$ variable and select $Employee_Data$ as the Array Variable.
    4. Drag the Message Box command and press F2 to insert $Employee_Data$ variable.
    5. In the Array variable dialog box, press F2 to select the $row$ variable in Row Value and the $Counter$ variable in Column Value.
    6. Click OK to save the values and click Save to save the message.
  7. Click Run to run the TaskBot.

Using the read from database array variable

  1. Open the Workbench.
  2. Create an array variable, for example $Employee_Data$, using the Database Assignment option from the Variable Manager.
  3. Drag the Loop command and select the Times option.
  4. Press F2 to insert the $ArrayRow$ variable and select the Array Variable as $Employee_Data$.
  5. Create a value variable using the Variable Manager, for example $row$, to iterate through the number of rows.
  6. In the Loop command, perform these steps:
    1. Drag the Variable Operation command, select $row$ in the Specify Variable drop-down list, and press F2 to select the $Counter$ variable in Specify value.
    2. Drag another Loop command and select the Times option.
    3. Press F2 to insert the $ArrayColumn$ variable and select $Employee_Data$ as the Array Variable.
    4. Drag the Message Box command and press F2 to insert the $Employee_Data$ variable.
    5. In the Array variable dialog box, press F2 to select the $row$ variable in Row Value and the $Counter$ variable in Column Value.
    6. Click OK to save the values and click Save to save the message.
  7. Click Run to run the TaskBot.
Send Feedback