Variables and Datatypes
Overview: 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 discuss the benefits of using variables and the type of variables that are appropriate for different use cases.
Variables are containers that hold values that can be used to 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. Conditional statements can be used for things like checking to see if the bot is already logged in to a page or not, handling the response from a web service to see if a request was made successfully, or checking the result of an operation contained within a Try-Catch-Finally block to determine if the operation ran successfully or not. The logic following a conditional statement only executes if the condition resolves to 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 false, an else action can optionally be used as a “catch-all” for actions that should be executed when all other preceding conditions are false.
Variables allow bots to be dynamic in the way they are 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.