Read and Review Automation Anywhere Documentation

Automation 360

Close Contents

Contents

Open Contents

Dictionary package

  • Updated: 9/21/2021
    • Automation 360 v.x
    • Build
    • RPA Workspace

Dictionary package

The Dictionary package contains actions that enable you to do various operations on dictionary-type values.

Dictionary data type

A dictionary is a collection of key-value pairs, in which each key has a value. It is similar to an entry in a dictionary, where each word has a corresponding definition or explanation. The key is similar to the word, and the definition or explanation is similar to its value. The properties of dictionary entries are as follows:

  • Keys are unique within each dictionary variable. If you try to duplicate a key, you will overwrite its value.
  • Key names cannot be changed.
  • Keys are case-sensitive.
  • Keys can contain leading and trailing whitespaces.

Each key-value pair in a dictionary is separated by a colon. The key-value pairs are separated from each other by commas. An example of a dictionary is as follows:

invoice = {'CustomerID': 9876, 'Location': 'XYZ', 'Amount': 12,34,567}

In the example, 'CustomerID', 'Location', and 'Amount' are keys, and the corresponding value assigned to each key is separated by a colon.

Working with variables of dictionary data type

A dictionary variable can hold values of boolean, number, or string data subtype. When initializing a dictionary variable, you can select the Any data subtype in order to hold any of the three data subtypes. You can manually enter values by creating a new variable or selecting an existing one from the Variables menu, and then clicking Add.

Use a dictionary variable to hold email or PDF properties.

Actions in the Dictionary package

The following actions are available:
Action Description
Assign Assigns the value of the source dictionary to the destination dictionary variable.
  • Select the source dictionary variable from the drop-down list or create a new dictionary variable.
  • Select a variable or create one to hold the output.
Get Verifies whether a key exists in a dictionary variable and returns the corresponding value.
  • Select the dictionary variable from the drop-down list.
  • Enter the key name.
  • Select a dictionary variable or create one to hold the output.
Put Assigns a value to a key in the dictionary. If the key is already associated with a value, the value can be updated.
  • Select the dictionary variable from the drop-down list.
  • Enter the key name.
  • Assign a value to the key.
    You can choose the Static value tab to add the values manually or the Variable tab to add the existing variables.
    Note: If you choose the Static value option, ensure that the data type of static value matches the subtype of the dictionary variable. Otherwise, you might encounter type cast errors when you use the dictionary variables.
  • Select the variable to hold the previous value.
Remove Removes a value from the specified key. The removed value is assigned to a variable selected from the Assign removed item to variable list.

Removes a value from the specified key and optionally assigns it to a variable selected from the Assign removed item to variable list.

  • Select the dictionary variable from the drop-down list.
  • Enter the key name.
  • Select the variable to hold the removed value.
Size Retrieves the number of entries in the dictionary specified in the Dictionary variable field and assigns the output to a number variable selected from the Assign the output to variable list.
Send Feedback