Dictionary and double example

I’m trying to collect such values with the for each loop, but I’m getting an error like in the photo, I couldn’t find the reason. I’m trying to do the example of practice 4: dictionaries and doubles in the rpa foundation education. ({{“New York”,2.1},{“Paris”,3.3}, {“Cairo”,1.3}, {“Chicago”,1.9}} },{{“New York”,2.1},{"Paris ",3.3},{“Berlin”, 0.8}} }

Hi,

Can you share exact type of CityList?
Or can you share your xaml file?

Regards,

1 Like

dictionary an doubles yapılamadı. uipath forumundan cevap bekleniyor.xaml (11.9 KB)

Hi,

As CityList is Dictonary<String,Dictionary<String,Double>>, CityList.Item(City) returns Dictionary<String,Double> and it cannot be added Double. In this case, I recommend to use KeyValuePair<String,Double> at TypeArgument of outer ForEach, as the following, for example.

dictionary an doubles yapılamadı. uipath forumundan cevap bekleniyor.xaml (11.5 KB)

Hope this helps you.

Regards,

1 Like

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