Add string to List of Strings using Invoke method



I want to add strings in list of strings at run time. I want to use invoke method activity.

Can any one guide me? is there any other option for doing this?


How to use Array of string

Hi @vishalgajjar11,

UiPath provides the Add to Collection activity which basically do the same.

But if you do prefer to use the Invoke Method activity , it would be something like this:


Main.xaml (6.1 KB)


Thank you for the help…:slight_smile:



It is possible to add a new value to a specific index of that list of strings?



Hi! @tiagofreire you can use the insert method to add items into the list at particular index.
I’ve edited the above worklow:
Main (9).xaml (6.6 KB)

Tell me if this helps!

Niket Ghai



Thank you, @Niket_Ghai!


Could you please mark it as solution :slight_smile:
It will help others to see what the answer was!


I can’t see the button to mark it. Maybe only the thread owner can do it?


Hi! It’s okay. yeah only the thread creator can mark as solution. You were right :slight_smile:
Anyway. Thank you.
Happy Automation


I didnt understand Insert function you used, there was no index anywhere mentioned.

Also how can we add multiple items in a list


You can add multiple items by using a foreach loop and placing the insert/add function in it!
And in the parameters property of Insert function we are providing the index!

Niket Ghai