Fetch value from key in dictonary

Hi
I have used microsoft dict for mapping

suppose example
{Karnataka, banglore}
{Tamil Nadu,chennai}

if collectionvariable.getvalue(“karnataka”)…it must print banglore

pls send the correct syntax

1 Like

Yah if the dictionary has these key value pair like
{{“Karnataka”,”banglore”},{“Tamil Nadu”,”chennai”}}

Then to get each value
Pass this dictionary variable a input to for each loop and change the type argument as system.collections.generic.keyvaluepair(of string,string)

Then inside the loop use a writeline to get the value like this
Item(“Karnataka”).Tostring

Cheers @KarthikBallary

is it holds good for microsoft dictonary also?

1 Like

Is it possible without loop just by passing key value

1 Like

Yah it would
So to get without passing to loop
Yourdictionaryvariable.ElementAt(0).Value
Where 0 is the index of the key value pair

Or
To be simple
Yourdictionaryvariable(“Yourkey”).Tostring

Hope this would help you
Cheers @KarthikBallary

3 Likes

Thank You

1 Like

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