Contains key Version 8 (Java)
Action group: Collections
Description
Determines whether the dictionary contains a key.
Action icon
Settings of parameters
Property | Description | Type | Filling example | Mandatory field |
Parameters | ||||
Dictionary | Dictionary to check | Robin.Dictionary | Yes | |
Key | Key to check in the dictionary | Robin.String | Yes | |
Results | ||||
Result | Logical variable whose value is true if the key is contained in the collection, otherwise false. | Robin.Boolean | true |
Special conditions of use
None.
Example of use
Task
There is a variable "Dictionary" with values: 1 - Moscow, 2 - Tokyo. Set up a check for the presence of key 5 in the dictionary and write the result to the boolean variable.
Solution
Use the "Contains key" action.
Implementation
- Create a variable "Boolean variable" to record the result of the "Find value" action into it.
- Move the "Contains key" action to the workspace and set the action settings.
- Launch the robot using the "Start" button in the top panel.
Result
Key 5 was not found in the dictionary
Обзор
Инструменты контента