Karun
(Karun Kumar Nalam)
1
Hi,
I have two dictionaries Config 1 and Config 2.
I’m trying to append Config 2 to Config 1, I found c# code in online
dictionaryFrom.ToList().ForEach(x => dictionaryTo.Add(x.Key, x.Value));
how can I implement this in UIPath
Thanks in advance.
1 Like
You can use For Each Activity to append the dictionary.
Set item type to dictionary object in the properties panel.
For Each item in Dictionary2
Dictionary1.Add(item.Key,item.Value)
sarathi125
(Parthasarathi)
3
Hi,
use an assign activity then try the following code,
dictionaryFrom.ToList().ForEach(Function(x) dictionaryTo.Add(x.Key, x.Value))
2 Likes
Karun
(Karun Kumar Nalam)
5
But It’s not returning any value We can’t use Assign activity here.
sarathi125
(Parthasarathi)
6
dictionary1.Union(dictionary2).ToDictionary(Function (k) k.Key, function(v) v.Value)
I am combining both dictionary and put all values into dictionary1 inside an assign activity.
2 Likes