Search code examples
rpaautomationanywhere

How to store multiple values in a variable during run time(dynamically) in Automation Anywhere?


I am trying to store multiple folder names in a variable during run time, because I want to access all these folders with their names later on.

This is what I have thus far:

Task screenshot


Solution

  • Unfortunately there's no graceful way to do this with a List variable. You could solve this in a multitude of ways though! To my best knowledge, I would go about it by creating a Array. This way we can access the folder names later without having to do any additional tricks.

    I started writing this out in text but realized a simple snippet would speak a thousand:

    enter image description here

    I opened line 5 on the right, to illustrate the reinitialize command.

    On line 9 you can see I can select any folder name from the array at will. Just make sure you do not enter a number greater than vFolderCount.