Get action in Dictionary
- Updated: 2024/07/01
Get action in Dictionary
Use the Get action in the Dictionary package to verify if a key exists in a dictionary variable and return the corresponding value.
Settings
- Select the dictionary variable from the drop-down list.
- Enter the key name.
- Select a dictionary variable or create one to hold the output.
Example of using Get Dictionary action in an automation
This example shows you how to create a bot that retrieves a dictionary
value from a dictionary variable.
- Create a bot.
- On the left panel, click Automation.
A list of available bots and forms is displayed.
- Click Create a bot.
- Enter the bot name: Dictionay_Get.
- Click Create and Edit.
- On the left panel, click Automation.
- Create the user-defined variables using the Create
variable (+) icon at the top of the
Variables menu.
- Create a variable of Dictionary type: AppraisalData_FY23
- Enter the following key-pair values in the AppraisalData_FY23:
Key Value Name Bob, John, Sarah Age 52, 26, 42 Job title Sr. Developer, Technical Writer, HR Email ID bob.jones@abc.com, john@abc.com, sarah@abc.com Phone number 752000000, 753000000, 754000000 CTC $160,000, $110,000, $100,000 Bonus component Sr. Developer: 15%, Technical Writer: 15%, HR: 15% Employment type Sr. Developer: Permanent, Technical Writer: Contractor, HR: Permanent
- Double click or drag the Get
action to retrieve a dictionary value.
- Select AppraisalData_FY23 dictionary variable from the drop-down list.
- Enter CTC in the Key field.
- To store the output, select SampleString from the Assign the output to variable field.
- To print the value of the dictionary variable, double-click or drag the Message box action. Select SampleString from the Enter the message to display field.
- Click Save and then Run.
The output is displayed as: