I am trying to use a data dictionary to storage my variables. However, when I use the activity “Add to dictionary” Uipath shows an error message which mentions the following “The dictionary has not been initialized”. My dictionary variable has a type System.Collections.Generic.Dictionary<TKey, TValue>
Can someone tell help me? What is missing? How can I must declare my variable to establish it as a data dictionary?
Hi Andra,
How do I assign a new value to my dictionary, I am trying to use the assign activity like data = data.Add(“hello”,“world”) where key is “hello” in this sample, but it cannot be done in that way, any suggestion?
If you’re working with dictionaries, I’d strongly suggest installing Microsoft.Activities.Extensions package - there’s a couple of very useful activities for them in there that will make your life easier.
Or you could use InvokeMethod, since .Add is void and thus cannot be used in Assign.