Skip to main content
Question

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


Forum|alt.badge.img+2

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.

 

13 replies

Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • 539 replies
  • September 27, 2024

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


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • 539 replies
  • September 27, 2024

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.


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • 6 replies
  • September 27, 2024
  • 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 

 


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • 6 replies
  • September 27, 2024

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


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • 539 replies
  • September 27, 2024

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.

 


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • 539 replies
  • September 27, 2024

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.


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • 6 replies
  • September 27, 2024

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 ?

 

 


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • 539 replies
  • September 27, 2024

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?  😉


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • 6 replies
  • October 18, 2024

Not working


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • 6 replies
  • October 18, 2024

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.


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • 539 replies
  • October 18, 2024

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.


Forum|alt.badge.img+2
  • Author
  • Cadet | Tier 2
  • 6 replies
  • October 22, 2024

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


Aaron.Gleason
Automation Anywhere Team
Forum|alt.badge.img+10
  • Automation Anywhere Team
  • 539 replies
  • October 22, 2024

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings