Error "Add to Collection"

Hello, please tell me what the error is, I create a list, initialize it, but the robot writes that there is an error

1 Like

Kindly check whether the ListFIleBW2 (list variable) is available in the scope of add to collection activity

1 Like

Hi @yulya ,

To resolve the error we have to initialize the list of string variable you created. Please use the below statement in the default section of your list variable. Thanks.

New System.Collection.Generic.List(Of String)

Please refer the below thread for more guidance.

1 Like

You are almost done
Just we need to initialise that list variable like this

Go to Variable panel → in default column mention any of the below

If you have a pre defined value then it has to be defined like this

New List(of String) from
{“value1”, “value2”,….,”value n”}


If you just want to initialise without any value then mention this

New List(of String)


Whenever you are initiating a collection variable like List or dictionary we need to initialise with default value
For example - dictionary has to be initialised like this

New Dictionary(of String, String)

If with value

New Dictionary(Of String, String) From
{“Key1”, “value1”},
{“key2”, “value2”}

Cheers @yulya


thank you!

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