Simon, reading your reply makes my question sound pretty stupid. In hindsight it is quite obvious that returning the result object in each iteration will not work. However, simply removing the return action was not enough. The changes I did to the result object in each loop iteration were
not reflected in the final result object I returned after the loop had
finished. It took me a while to figure out why, until I read this paragraph in the documentation:
"A global variable is a variable that keeps its value during the entire execution of the robot. This is different from object attributes, whose values are not kept across loop iterations and branches."
The solution was to create a global variable before entering the loop and then append each thumbnail URL to it. I thought I would document my solution here, in case anyone else runs into the same kind of problem.
To append the URL, I used three steps (performed each iteration):
- Extract the URL to a temporary output attribute
- Use "Get Global Variable" to store the variable in an attribute
- Use "Assign Global Variable" and write an expression which concatenates these two attributes. Assign the resulting value to the global variable.
(It is possible that the second step is unnecessary, but I could not figure out how to use the global variable in the assignment expression)
After the loop has finished executing (and in a different branch), store the global variable in the proper attribute before finally returning the result object. Done.
Thanks for all the help, the robot is working as expected now.