Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (5.8k points)

The list starts empty. Then I want to append a value to it for each iteration in a loop if a certain condition is met. I don't see append option in Variable Operation.

1 Answer

0 votes
by (29.5k points)

You can use string split for this,. I've used a semi-colon, and $local_joinedList$ starts off empty.

If (certain condition is met)
 Variable Operation: $local_joinedList$;$local_newValue$ To $local_joinedList$
End If
String Operation: Split "$local_joinedList$" with delimiter ";" and assign output to $my-list-variable$

This overwrites $my-list-variable$.

If you need to append to an existing list, you can do it the same way by using String Join first, append your values to the string, then split it again afterward.

String Operation:

Join elements of "$my-list-variable$" by delimiter ";" and assign output to $local_joinedList$
 

Browse Categories

...