Add string to List of Strings using Invoke method


#1

Hi,

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?

Thanks,
Vishal


#2

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:

image

Main.xaml (6.1 KB)


#3

Thank you for the help…:slight_smile:


#4

Hello.

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

Thanks!


#5

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!
Regards

Niket Ghai


#6

Awesome!

Thank you, @Niket_Ghai!


#7

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


#8

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


#11

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


#12

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

Also how can we add multiple items in a list