Want to get the Key name from value of the dictionary

Hi Everyone,

I have created a dictionary like
for each row of a table
Config(row(“key”).tostring)=row(“Value”)

Now i have created an array of the values using key as below:
Array={Config(“abc”).ToString, Config(“efg”).ToString, Config(“hij”).ToString, Config(“klm”).ToString}

now i have applied a loop to find the missing value
for each item in array
if
String.IsNullOrEmpty((item.ToString))
WriteLine = item+“is missing”

Here I am not getting anything in item as the value of item is empty, i want the key name of item to print here.
any idea how to get this done.

Any help is appreciated.

1 Like

hi @uipexplore

try below activity to add new item (key and value) to a dictionary
image

hope it will help you
Ajay

Thanks for the reply but i dont want to add in the dictionary,
I want the key name of the item.

Hi @uipexplore,
1.If you are keeping in the order then keep an index variable and find the index where it is showing null.
2.You can get the keys by dictionaryNames.keys and take the key according to that index.
3.if there are more null values keep the indexes in an array and use.
Hope this helps…
Cheers.
vashisht.

I want the key name of that particular values for which i am getting null.

array already been created of the values

No bro,
var index=0
for each item in array
if
String.IsNullOrEmpty((item.ToString))
array[i]=index;
index=index+1;
}
DictionaryName.keys gives the keys list.
the above index number in the above list gives the required key whose value is null.
Cheers.

hi @uipexplore

try like below

ForEach  pair(key,Value)  In  dictionary1
    If pair.Value = Null or Empty   Then
          print (pair.Key)
    End If
Next

Regards
Ajay

now want the value of the key name of the particular items

Bro did you understand my solution.

Just keep another variable called index and increment it.If the if condition is met store that index.and search with that index in DictionaryName.keys list that is the required key.