What does this Message mean: The property 'Collection' of 'Add to collection' is not initialized


What does this Message mean: The property ‘Collection’ of ‘Add to collection’ is not initialized.
And how can i solve this problem?

Source: Add to collection

Message: The property ‘Collection’ of ‘Add to collection’ is not initialized.


1 Like

Hello, have you tried assigning a value to your collection before adding something in it ?
Try something like : (Assign Activity) yourCollection = New System.Collection.Generic.List(Of String) , for example

EDIT : I could give you a proper answer if you’d share your .xaml file :wink:

Best regards,


1 Like

Uipath binders maken facturen.xaml (17.7 KB)

Hello Mustafa

I am trying to merge serveral pdf files.
First i am trying to find the pdf files in the folder wich contains a substring “aab”
those files i am trying to add to a list with the activity Add to collection.
But then i get this warning


My guess is that you mistake Arrays for Collections.
They are 2 different classes in vb.net.
Your MergePDF activity needs an array while your AddToCollection activity needs a collection.
From there comes your mismatch.

What I did is :

1 - I created a new variable that will iterate through your foreach, counter
2 - I renamed your collection_raab_files variable into array_raab_files for the semantic (please keep in mind that arrays =/= collections)
3 - Each time you add an item into your array, increment counter by one

Uipath binders maken facturen.xaml (21.3 KB)

Tell me if this works :wink:

1 Like


but know i get an other warning



Sorry for the error, it’s a bit difficult to work without being able to debug it :wink:
Let me check it again

Indeed, I forgot to change counter’s scope. Therefore, the variable was unknown to the greater scope.

Try this : Uipath binders maken facturen.xaml (21.3 KB)

it happens by the third assign activity

there is no variable called: array_Raab_files(counter)

The left part of the assignment means “the value of the array slot at position counter will be…”, therefore, the syntax should be ok. I think the problem comes from the array not being declared previously. Please try :

Uipath binders maken facturen.xaml (23.1 KB)

i think we are getting close to the solution
i have another warning:


Let’s try something messy… could you please test this ?

Uipath binders maken facturen (1).xaml (23.1 KB)


From now on, I can’t really help you. You know which path to put in “FolderPath”… :wink:

thanks Mustafa

We are close
But know i am getting a new warning :disappointed_relieved:

This means you have to leave either “FolderPath” or “MergedFilePath” empty.
Good luck ! :wink:

I have tried both.
I think that some thing is wrong with the input in FilePathArray : array_Raab_files

I cannot really help you on this one, as this is not an official nuget package you are using, I don’t know how to use it, sorry… :frowning:

You’re close anyway ! (I’ll try to correct the messy array[200] whenever I’ve got some free time :wink: )

1 Like