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

@MasterOfLogic 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

Hello David,
In this video I have multiple examples with Dictionary:

Thanks,
Cristian Negulescu

1 Like

got resolution?

1 Like

Yes Thank you so much. I cant see the link to mark the solution