Data Types#

Main Variable Types in Sherpa RPA#

In Sherpa RPA, a variable's type is selected in its properties and determines what it can store: text, numbers, tables, lists, dates, Boolean values, and other data.

The table below lists the main Sherpa RPA variable types and their close programming equivalents.

Type in Sherpa RPA Programming equivalent Example use
Text String Stores text such as names, addresses, and filenames. Literal text values are enclosed in quotation marks.
Number Integer, Float, Double Stores integer or fractional numbers. Numbers are written without quotation marks; use this type for quantities, identifiers, percentages, or calculation results.
DataTable DataFrame, Table, 2D Array Stores a table with rows and columns. A table can be loaded from a file, processed, and saved, including as JSON.
List Array, List Stores an ordered collection of values. You can access an item by its index, for example the second item in a list of cities.
DateTime DateTime, Date, Time Stores a date or a date and time, such as a request creation date, deadline, or robot start time.
Dictionary Dictionary, Map, Associative Array Stores key–value pairs, such as "Request number" → "12345" or "Status" → "New".
HashTable HashTable, Dictionary Stores key–value pairs in a table with "Key" and "Value" columns. Pairs can be entered manually, loaded from a JSON file, or saved to one.
Logical Boolean Stores true or false. Use it in conditions, for example to check whether a document was found.
Money Decimal, Money (specialized type) Stores monetary amounts such as a price, payment, fee, or total cost.
SecureString SecureString, Encrypted String Stores a confidential string in protected form, such as a password. The value is not written in plaintext to a log or external text file.
Object Object, Pointer Stores a reference to data or an object rather than the data itself. For example, a variable can refer to an object returned by an external application.

Type Conversion#

When working with PowerShell values, you may need to convert one value to another type, such as a string to a date or a calculation result to text.

  • Convert a string to a date:
"5/7/07" -as [DateTime]
  • Alternative conversion with a type cast:
[datetime]"5/7/07"
  • Use a method of the Convert class:
[Convert]::ToDateTime("5/7/07")
  • Convert a numeric expression to a string:
(1 + 1 * 2).ToString()