How to initialize a collection variable

collections

#1

I’m trying to add an item to a collection type ICollection, but when I do it I get this error:

“The property ‘Collection’ of ‘Add to collection’ is not initialized”

How can I initialize a collection then?


#2

Hi,
You need to first initialize list using assign activity then pass the item to the add collection.
items=new List(of string)
Please refer.


#3

hi @ddpadil

Add to collection is replacing objects instead of adding them one by one.

So can i do this- I am using Assign activity

sel1= new list(ofString,list(ofString))

Is this the correct format?


#4

Hi @SHAISTA,

Please don’t create duplicate post.
Refer Below

Thanks,
Arivu