Utils Object

The utils object $Utils provides access to some utility functions for generating values for specific types.

Name Description Type Usage Example
GetBoolean(string value) Parses specified value or variable to a boolean, allowing boolean operations and functions. Boolean $Utils.GetBoolean(%truthyVariable%).And(True)$ True
GetDate(string value) Parses specified value or variable to a date, allowing date operations and functions Date $Utils.GetDate("12/12/2018").Month$ 12
GetDateTime(string value) Parses specified value or variable to a date-time, allowing date-time operations and functions. DateTime $Utils.GetDateTime("12/12/2018 12:15").Minute$ 15
GetNumber(number value) Parses specified value or variable to a number, allowing numeric operations and functions. Number $Utils.GetNumber("100").Add(1)$ 101
GetNumber(datetime value) Returns the number of ticks in a specified date-time value. Number $Utils.GetNumber("12/12/2018 12:15")$ 636802137000000000
GetString(string value) Parses specified value or variable to a string, allowing string operations and functions. String $Utils.GetString("lower case sentence").Replace("lower", "UPPER").ToUpper()$ "UPPER CASE SENTENCE"
GetTime(string value) Parses specified value or variable to a time, allowing time operations and functions. Time $Utils.GetTime("10:05").Minute$ 5
GetTimeSpan(string value) Parses specified value or variable to a time span, allowing time span operations and functions. TimeSpan $Utils.GetTimeSpan("12:25:14.333").Seconds$ 14
NewGuid([string formatString]) Create a new randomly generated GUID, optionally with a specified format. The format parameter can be "N", "D", "B", "P", or "X" String $Utils.NewGuid()$

$Utils.NewGuid("N")$
"da47b2d6-3580-48ed-b27a-f152da2345e6"

"911bbf6caaa94815ac7c18e88e812e82"
RandomNumber([integer maxValue]) Generate a new random integer value.

If one parameter is provided it designates a random number in the range of greater than or equal to zero and less than the maxValuenumber provided will be generated.

If no parameters are provided a 32-bit integer greater than or equal to zero and less than Int32 max value (2,147,483,647) will be generated.
Integer $Utils.RandomNumber("10")$

$Utils.RandomNumber$
2

1906529119
RandomNumber(integer minValue, integer maxValue) Generate a new random integer value.

The parameters provided designate the range for the generated number. A random number in the range of greater than or equal to minValue and less than the maxValuewill be generated.
Integer $Utils.RandomNumber("1", "10")$ 5
RandomString(integer length) Generate a new random string value.

The parameter provided designates the length of the string value.
String $Utils.RandomString("5")$ "kgw3Y"