Is there an option to change existing value to new value for a particular key in a dictionary data type, or should we use remove followed by add to get this done.?
1996
(Neelima G)
August 18, 2020, 2:07pm
2
Hi @JayakumarSanthanam ,
Check below links hope this will helps you.
I am trying to update dictionary values based on search operation done on Dictionary key.
when i print default values of Dictionary using for each, it prints well.
but when i update the value of keys, then i get error as.
collection was modified enumeration operation may not execute on second run.
Hi People,
I declared a dictionary, newDict = New Dictionary(Of String, Decimal), however i intend to add random peoples names as string and a decimal value to the dictionary, i also want to ensure that names aren’t repeated and for the repeated names, whatever decimal value i pass should be added to the value in the dictionary. For instance
New Dictionary {“James Smith”, 7.8; “Luke Jake”, 12.7; “Brain Smart”, 8.9}
First i checked New Dictionary.containsKey(persons name).
Now i need to get …
If it works, mark it as solution.
Thanks,
Neelima.
Udhay
(Udhayanidhi Natarajan)
August 18, 2020, 2:25pm
3
HI @JayakumarSanthanam ,
You can directly use an assign activity to modify the value for any key.
dict(“key”) = newValue
If the key is not present in the dictionary, then a new key value pair is created in this case.
Happy coding!
2 Likes