How to get a dictionary key by passing its value

Hello,
Please how do i get a dictionary key name by passing its value. is there a method for that please.

Regards

@David_Oku You can try this :

dictVar.Where(Function(x)x.Value.Equals("yourValue")).Select(Function(x)x.Key).First

But keep in mind that the values might not be unique, so there may be multiple keys having the same value. The above expression fetches the first match of Value it finds.

2 Likes

GetDictionaryKeyOnValue.zip (23.1 KB)
Hi,
Please find the attached workflow file

Hope it helps.
Mark as solution if it works for you

Thank you :slight_smile:

2 Likes