Read and Review Automation Anywhere Documentation

Automation Anywhere Version 11.3

Close Contents

Contents

Open Contents

System Variables - Loop

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

System Variables - Loop

A Loop system variable complements the Loop command and works within the scope of a defined loop. Most loop variables have no value when used outside of loops.

You can manage your Loop command using the variable options in the following table.

Image displaying Loop related variables

Example 1:

Start Loop "Each File In Folder D:\My Desktop\JAVA"

Comment: Please enter your commands to loop. Use $filename$.$extension$ variable for each file name in the Loop.

End Loop

Start Loop "Each row in an Internet Explorer Table of Session: Default"

Comment: Please enter your commands to loop. Use $TableColumn$ variable for each row in Table.

End Loop

Example 2:

  1. Comment: -------------------------------------- Start XML Session-------------------------------
  2. XML : Start XML Session using
    existing file "D:\My Desktop\XML Files\Bookstore -
    1.xml"Session:Session1
  3. Comment: -------Get Multiple Nodes, I have set Xpath Xpression as Book [1], means only First Occurance -------
  4. XML : Get Multiple Nodes text value from XPath expression "//book[1]/author". Session:Session1
  5. Comment: -------------- Use Loop for "Each Node in XML Dataset" -----------------------
  6. Start Loop "Each Node In a XML Dataset Session: Session1"
  7. Comment: --------- Pring Node Value to Message box using SYSTEM Variable "XML Data Node (Node Name)" ---------
  8. Message Box: "$XML Data Node(author)$"
  9. End Loop
  10. Comment: ------------ Get Multiple Nodes, I have set Xpath Xpression as "Lang", means only All Occurance --------
  11. XML : Get Multiple Nodes attributes name "lang" from XPath expression "//book/title ". Session:Session1
  12. Comment: -------------- Use Loop for "Each Node in XML Dataset" -----------------------
  13. Start Loop "Each Node In a XML Dataset Session: Session1"
  14. Comment: ---------Pring Node Value to Message box using SYSTEM Variable "XML Data Node (Node Name)" --------
  15. Message Box: "$XML Data Node(lang)$"
  16. End Loop
Send Feedback