If you want to work with a collection that doesn’t have a fixed number of elements, you can use a list instead of an array.
A List expands as you add new items to it. You can add new items to a list using the Add To Collection activity (you will find it under Programming->Collection category).
The attached ListExample workflow shows you how to declare, init, add and display items from a list.
Workflow Steps
DynamicArray_List_logic.png
Initializing the list:
items=new List(of string)
Get the input for the list, using an InputDialog activity.
The new element (name) is added to the items collection (with Add To Collection activity).
DynamicArray_AddToCollection.png
The robot asks if you want to continue adding new elements (using Message Box activity). The response is saved in the answer variable.
A decision is taken (using a Flow Decision activity): if the answer to the previous step was Yes, the workflow will return to step 2. A No answer will move the workflow to the next sequence (step 6).
DynamicArray_Decision.png
The sequence will go through each item in the list. It will pop up a window with the inputName of each element.