Add To Dictionary

The Dictionary is a collection of Keys and Values, where key is like a word and value is like a
definition.Thus, The Dictionary is a general collection of keys and values pair of data. This is
used to store and retrieve data temporarily when the project is running. The Dictionary class
implements the IDictionary<TKey,TObject> Interface. User can store the values in any defined
data type in value.

Technical Reference

 

 

 

INPUT

Dictionary: Declare the name of the dictionary here as a variable.

Key: This indicates the content in the dictionary. E.g., Name

Value: This indicates the value that represents the key. E.g., Age

 

 

 

 

 

MISC

ArgumentType1: This indicates the type of the key we will be using. Choose from the drop down.

ArgumentType2: This indicates the type of the value that represents the key value. Choose from the drop down

Display Name: Displays the name of the activity. You can also customize the activity name to help troubleshoot issues faster. This name will be used for logging purposes.

SkipOnError: It specifies whether to continue executing the workflow even if it throws an error. This supports only Boolean value “True or False”

True: Continues to execute the workflow irrespective of any error thrown.

False: Stops the workflow if it throws any error

Version: It specifies the version of the Dictionary feature in use

 

OUTPUT

Result: Define a Boolean to validate if the activity has been completed successfully. This is not a mandatory field.

*Mandatory fields to execute the workflow

Use Case

The following activity illustrates on how we are going to use the add dictionary
activity to store the name and age of individuals. We are also going to use the
view activity from dictionary to view the added values.

Steps to execute the bot

1.     Drag and drop an add to dictionary activity to the workflow.

2.     Click on the activity and enter the required details in the property box.

3.     Declare a variable as the Dictionary name. Here we are going to declare the
name as “DictNameAge” and enter the default VB expression as mentioned above.

4.     Enter the content in key. Here we are going to use Name as the key. So, enter “Ram”

5.     Enter the value of the key. Here we are going to enter the age as the value. So, enter 45

6.     Choose the ArgumentType1 as String since the name is a string.

7.     Choose the ArgumentType2 as Int32 Since the age is an integer.

8.     Drag and drop as many add to dictionary tabs as required to add that many values
to the dictionary.

9.     In this activity we will be using three add to dictionary tabs. The dictionary name and the
ArgumentType1 and ArgumentType2 will be the same in all the three tabs since we are
adding the same key and value to the same dictionary.

10.  We can view the dictionary by using the “View” activity in Dictionary

11.  Enter the Dictionary name, ArgumentType1 and ArgumentType2

12.  Enter a message title that will pop up showing the dictionary.

13.  Execute the activity.

The Bot executes the activity, adds the values to the dictionary and displays the same using
the view dictionary.