BACK

Introduction to Advanced Datatypes

In this section, we will discuss about two advanced data types: Lists and Dictionary

List Type Variable: A list is a collection of ordered values. You can use a list type variable when you need to retrieve multiple values, one by one. The values can be of Boolean, number, or string data subtype. You can select the Any data subtype in order to hold any of the above mentioned three data subtypes.

For example, the list variable $listOfPlanets$ has the following values: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, and Neptune. The Number variable $indexPosition$ has value of 2. The expression $listOfPlanets[$indexPosition$]$ returns Earth.

Common uses of list variables include:

  • Sending an email to multiple recipients

  • Searching multiple web addresses

If you are using a List action in a Loop action, you must use the For each item in the list iterator.

List package consists of the following actions: Add Item, Assign, Clear, Get Item, Join Items, Remove Item, Set Item and Size.

Read more about the List type variable here: https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/cloud-list-command.html

Dictionary Type Variable: A dictionary variable is a collection of key-value pairs, in which each key is mapped to a value. It is similar to an entry in a dictionary where each word has a corresponding definition or an explanation. The key is similar to the word and the value is its definition.

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’: 1234567}

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

When you automate a PDF-related task, Automation Anywhere Enterprise retrieves various properties of the file and stores the values of these properties in a dictionary variable.

Automation Anywhere Enterprise retrieves the PDF file name and extension, title, subject, and author. The file properties are stored in a dictionary variable within the following keys:

  • pdfTitle

  • pdfFilename

  • pdfSubject

  • pdfAuthor

The system automatically associates the properties of a PDF with the appropriate dictionary keys.

For example, if you create a dictionary variable Test and want to log the file name and author, you must enter Test{pdfFilename} and Test{pdfAuthor} in the appropriate fields.

Similarly, when you automate an email-related task, Automation Anywhere Enterprise retrieves various properties of an email and stores the values of these properties in a dictionary variable. These properties are stored in a dictionary variable when you use an email action within a loop action.

The Dictionary package contains actions that enable you to do various operations on dictionary-type values. Actions supported in the Dictionary package are: Assign, Get, Put, Remove & Size.

Read more about the Dictionary type variable here: https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/cloud-dictionary-command.html