Question: How do I update the value of a kevaluepair inside a dictionary?
I have a dictionary called out_Config defined as Dictionary<String,Dictionary<String,Object>> That is the output of UiPath.Web.Activities.DeserializationJson.
out_Config is populated by deserializing a JSON string that looks like
“SMTPFromEmailAddress” : “SMTPFromEmailAddress”,
“SMTPPort” : “SMTPPort”,
“SMTPServer” : “SMTPServer”,
So the GlobalAssets node is a dictionary of keyvaluepairs accessible by out_Config(“GlobalAssets”).
What I am trying to do is loop through the out_Config(“GlobalAssets”) dictionary to get the asset value of each keyvaluepair stored in Orchestrator and then update the value in the dictionary. The get asset activity is successful.
My current implementation of out_Config(“GlobalAssets”).Item(item.Key) in the assign activity is throwing the error “For Each: Collection was modified; enumeration operation may not execute.” I think this is because I am updating the key and not the value.
What should I put in the left side of the assign activity to update the value of the key?