Dictionary variable

Hi all ,
How to create dictionary variable (key, value 1, value 2, value 3) one key and number of values
Please help me
@Palaniyappan

@narendra_katteboina You can Create a Dicttionary where it’s key is of type String, and Value is of type List(Of String) in this way,

exampleDict = new Dictionary(Of String,List(Of String))

Make Sure example dict is of the Type Dictionary(Of String,List(Of String))

If you want to Assign values to the Dictionary you can do so in this way,

exampleDict(“key”)={value1,value2,value3}

1 Like

@supermanPunch


Attached image is my config Excel file …Name column is key and To_mail_id and cc_mail_id and customer_name column’s is values ,can you please explain …
I am trying but facing issue

@narendra_katteboina Sorry, Can you convert the dictionary to Dictionary(Of String,String()). I think it’s better if the values are not being modified to keep the type as String() :sweat_smile: .

This Could be changed to :
exampleDict = new Dictionary(Of String,String())

You can then use this properly.

If the Array data in the dictionary needs to be modified, then a List(Of String) would be a better idea.

Also you would need to change the type of exampleDict to Dictionary(Of String,String())

To Access the each value Based on the Key, you can do the following:
exampleDict(“key”)(0) - To get value1
exampleDict(“key”)(1) - To get value2
exampleDict(“key”)(2) - To get value3

2 Likes

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