Get keys from Dictionary by their values

Hi there,
I need to iterate through Dictionary(String,String) and get its keys by values. Afterwards check (if value = “abc”) - then get its key.
Now I stucked on the first step, can’t even get the values.
See screenshot attached.
Thank you.
IMG_4752|666x500

2 Likes

Do something like this

For each item (as string) in dictionary.keys
{
if( dictionary (item).Equals(“abc”) then
SavedKey = item
}

1 Like

I have just changed TypeArgument in “For each” to System.Collections.Generic.Idictionary… and got and access to values after typing dict.. But now I recieve this kind of error:

I have come to this point finally. How can I get key by value?
When i write in messagebox item.keys - there is a compile error…

Main.xaml (7.6 KB)
Have a look at this, hope it will help you :slight_smile:

1 Like

I have solved it other way. But your’s is good too! I’ll take it into consideration.
Thank you!

2 Likes

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