Looping can be a powerful tool when you have repeated actions in your Flow. Down below some tips on how to use Loops to your advantage:
In Liberty RPA Studio ‘Loop’ can be found on the bottom left under ‘Special Nodes’. If you double click on a Loop activity you can find it’s properties.
A loop node requires the setting ‘Run loop for every XXX in YYY’.
It is important to understand that in YYY represents a list, while XXX represents a variable from that list.
A list is a data structure in that is a mutable, or changeable, ordered sequence of elements. Each element or value that is inside of a list is called an item. Just as strings are defined as characters between quotes, lists are defined by having values between square brackets [ ].
There are multiple ways we can create list in Liberty RPA Studio, activities such as ‘List files in folder’ or ‘Read list from .txt file’ return a list by default. Alternatively we can create our own by defining one like this:
[‘apple’, ‘pear’, ‘banana’]
We can fill this in the Loop properties:
Note that for every iteration of the loop, a list item gets stored in the variable ‘fruit’. If we refer to this variable in this Loop it will contain the actual string. We could for example use this variable fruit to write the content in a field with Liberty RPA Wand, or write it in an Excel file or a database.
Good luck with Looping!