How to add the string value in collection inside a loop

I have been trying to add the string values in Add to Collection activity.
The requirement i have is i need to add the values inside the Add to collection activity inside a foreach row loop.
I am not getting how to add the string values into Add to collection activity.

Please Suggest

Hi @NJ0011 ,
Welcome to UiPatgh Forum :slight_smile:
Use Add to collection activity to add a string value into Collection.


@arivu96 , I dont have Idea how to pass the string variables inside the add to collection activity.
Later on I need to pass the collection activity in a add data row activity

Hi @NJ0011 ,

Have you tried setting the TypeArgument as String?

Kind Regards,
Ashwin A.K

Hi @NJ0011 ,
Refer below image


ensure your Collection as a datatype of List(Of String) is initialized: new List(Of String)

then item is the value
Collection: is your list variable name

@NJ0011 Please go through the below video

Hi @NJ0011

Try with ADD TO COLLECTIONS activity

Have a look on the thread

HI @NJ0011

Welcome to Community !!

in add to collection activity properties give your collection variable in the Collection field and in item use the string variable

if you are using For Each row in datatable use it like this in the item field

If you are using For Each

Note: In my screenshot it is throwing error because the add to collection activity is not inside any of the loop activities

Hope this Helps


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.