Skip to main content

Hi RPA Experts, kindly help me how to get value from Dictionary variable , with latest community update we are facing challenge to provide key to dictionary variable.

 

Dictionary variables are key/value pairs and can contain a number of variable types, including strings. First, you need to know what kind of value the Dictionary contains. For example, if it contains strings, that Dictionary variable can be used anywhere a String variable could be used.

When you press F2 (or select the Insert Variable icon), choose your Dictionary variable and enter the key. That will return the value associated with the key.

For more information about Dictionary variables, please see this article on our docs site:

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/developer/cloud-dictionary-variable-example.html


This is what I see (and you’re right… it is quite different):

Message Box set with Dictionary of Strings

You should be able to display a Message Box with Dictionary of Strings or Dictionary of Any, with the caveat that a Dictionary of Any will return an error if the value contained in that Any key is anything other than a string value.


  • Aaron.Gleason this is old one , pls update the bot agent and try now, you will face challenge.

Before update old version : Working fine

 

New version : Not working - UI itself different 

 


I am getting empty message box as output and in methods I can see only string operation, Also I tried with Get action from Dictionary.

Not sure how to get the value from dictionary. 

 

Where to give key .. this is the big question 

I can see variable and String.. no option for key


I’m not able to replicate the blank value using a Dictionary of Strings. I might recommend running your automation in Debug mode and inspecting the value of the Dictionary variable.

 


Working with a Dictionary variable has turned into a two-part endeavor: First, select the Dictionary variable.
 

Then click Add expression item and enter the key “By name”.
 

I think that’s what you have in your second screen shot a few posts above.


Yes correct , but message box is empty , I am getting value from pdf file using extract field.

example - invoice number - 12345

So InvoiceNumber  is key 

 

Now I can see when we give Key as String , it’s not adding double quotes, may be due to this ?

 

 


You can try adding the double quotes. It won’t hurt anything. Usually, if the key contains a space (as mine does with “First Name”), the system puts double quotes around it. Your key, InvoiceNumber, doesn’t contain a space.

I still might set a breakpoint at your Message Box and run in Debug mode so you can inspect the Dictionary variable values. Can’t hurt, right?  😉


Not working


I am using form fields from PDF and getting Invoice number, but when I try to use Dictionary + key to get the output , I am getting empty.

Not sure how to get dictionary value.


Keys are CASE SENSITIVE. Make sure you’re using the correct key. If you’re not sure, run the automation in Debug mode and set a breakpoint on an action after where you set the value. This will allow you to inspect the values of the dictionary variable AND see the keys.


Everything correct, not only me .. my friends also facing this issue, tried all possibility. 


I am seeing a dictionary variable with an empty key as well. It appears this action is not working properly. Previous versions of the package do not seem to resolve the issue.


Reply