With the introduction of new data types in Automation 360, developers have the flexibility to store and interact with new types of data as they call subtasks, read from an HTML table, and iterate through CSVs. In this learning experience, we’ll review different user cases and discuss the benefits of using variables and learn which types of variables are appropriate.
Variables are containers that hold values that can store and retrieve data during bot execution. Variables all:
Have a name - which is how they are accessed and referenced within the bot’s logic
Have a value - which is what’s actually inside the variable (null to start for most variables)
Have a type - which is an indicator of the expected type of data they contain
In Automation 360, variables are now strongly typed. Strong typing keeps the behavior of the logic explicit during run time by enforcing data typing and explicit conversions.
Conditional statements in bot building allow developers to execute different actions based on the evaluation of pre-defined conditions. Developers often use conditional statements to check to see if they logged the bot into a page or not, to see if they successfully requested a response from a web service, or to check they successfully ran an operation contained within a Try-Catch-Finally block. The logic following a conditional statement only executes if the condition resolves to be true, however, additional conditions can be evaluated by the use of else-if actions. Finally, if the condition and all subsequent else-if conditions all resolve to be false, you can optionally use an else action as a “catch-all” for actions when all other preceding conditions are false.
Take a look at the following video on How to User Variables in Automation 360.
Review the documentation for variables and datatypes.
See an overview on the variables in Automation 360 and the documentation for user-defined variable types. In the user-defined variable types document, pay close attention to the “Variable type with naming recommendation”. Establishing and following a standard for variable naming enables for cleaner code that other developers can follow easier.
Note that the “type” of variables from the first link is referring to the kinds of variables that exist in Automation 360 while the “type” of variables referenced in the second link is referring to the actual “datatype” on which the variable is based.
Variables allow bots to be dynamically set up and flexible when working with different-sized data sets. The introduction of new data types in Automation 360, enables developers to have more control over their data, perform data manipulations more easily, and explicitly convert from one type to another as needed.