Get value Version 10 (Java)

Action group: Collections


Description

Gets the value associated with the specified key.

Action icon


Settings of parameters

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
DictionaryThe dictionary to search for an elementRobin.Dictionary
Yes
KeyThe key by which the dictionary lookup is performedRobin.String
Yes
Results
ResultThe resulting variable containing the value associated with the specified keyRobin.Object

Special conditions of use

If you specify a non-existent key in the "Key" parameter, an error will be generated.

Example of use

Task

There is a variable "Dictionary" with values: 1 - Moscow, 2 - Tokyo. Get the value of key 1 and output it to the dialog box 

Solution

Use the "Get value" and "Message" actions. 

Implementation 

  1. Create an "object" variable to record the result of the "Get value" action into it.
  2. Move the "Get value" action to the workspace and set the action parameters
  3. Move the "Message" action to the workspace and set the action parameters
  4. Launch the robot using the "Start" button in the top panel. 

Result

The value for key 1 is retrieved from the dictionary and displayed in the dialog box 

 

  • Нет меток