Add values to list in dictionary


I want to create a dictionary like: new Dictionary(of String, System.Collections.Generic.list< String>)

For the first moment, I need to build the keys, and assign to them values (1 dimensional list) in a for each loop

Further in process, i want access each key of the dictionary and append items to the existing list, also in a for each loop

Can anyone help?

1 Like

you can use Assign activity like this!


Actually, i was able to understand what the problem was.

I had to initialize the list before assign it for the first time to the dictionary key.

So in the beggining:
Dict = new dictionary (of string, System.Collections.Generic.List(of string))

And in the first for each loop:
TestList = new system.collection.Generic.List(of string)
Add to colection activity (collection = TestList)
Dict(Key) = TestList

And in the second for each loop:
Add to collection activity (collection = Dict(Key) )


Can you please give me some example?