Read Dictionary key value without using for each row

I have a variable with Dictonary<String,Object> like

varTestDictionary → variable type (Dictonary<String,Object>) and default value as new dictionary(Of String, Object)

and then I have many assign activities which is soting data into dictionary as

varTestDictionary(“Name”) = “Peter”
varTestDictionary(“Age”) = “45”
varTestDictionary(“Salary”) = “35000”

I have a more then 45 values in the dictionary and I have to use those value on different places.. So what I want is how can i get perticular key value on different places without using for each row activity.

Can I or not?
If yes then what is the way.

accessing the dictionary value by key we do:

Assign Activity
strMyValue = myDictionaryVar("MyKey") // optional conversions e.g. toString

Example:
varTestDictionary("Name").toString will return: “Peter”
CInt(varTestDictionary("Age").toString) will return 45 as an int32

2 Likes

Hi @Shazi_Latif

you can directly access the value of a specific key from the dictionary using varTestDictionary(“Key”) without needing a For Each activity. For example:

varTestDictionary(“Name”)
varTestDictionary(“Age”)

Happy Automation

Thanks for the Answer.

FYI For Each Row in Data Table is specific to datatables and has nothing to do with dictionaries.