Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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.8k 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$

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers


94.7k users

Browse Categories