Random values

You can use Value Expressions to generate random values, for instance if you want to generate passwords for new users:

Generate integer values

If you want to generate an integer value, you have the following options:

  • Generate an integer without limits

  • Generate an integer within a certain range

The maximum number of digits you can generate is 18.

To generate an integer without limits, use the syntax {RND[Length of random number]}.

To generate an integer within a certain range, use the syntax {RND[Lower limit][Upper limit]}.

The value of the parameter Lower limit must be less than the value for Upper limit. You can also enter negative values.

The generated integer is a value that lies between the upper and lower limit, boundaries included.

This example shows how to create the two types of integers:

{RND[7]} creates a 7-digit number.

{RND[-789][123]} creates an integer number from -789 to 123.

Generate a random number with decimals

If you want to generate a random number with decimals, you have the following options:

  • Define the number length, i.e. the number of digits and the number of decimal places

  • Define a number within a certain number range with a specified number of decimals

The maximum number of digits you can generate is 18.

To define the number length, use the syntax {RNDDECIMAL[Length of random number][Decimal places]}.

To define a number within a certain range with a specified number of decimals, use the syntax {RNDDECIMAL[Decimal places][Lower limit][Upper limit]}.

The value of the parameter Lower limit must be less than the value for Upper limit. You can also enter negative values.

The generated integer is a value that lies between the upper and lower limit, boundaries included.

This example shows how to create the two types of numbers:

{RNDDECIMAL[5][2]} creates a 5-digit random number with two decimal places.

{RNDDECIMAL[4][130][200]} creates an integer number from the value range 130 to 200, with four decimal places.

Random strings

Random strings are a mix of random numbers and letters.

To generate a random string, use the syntax {RANDOMTEXT[Desired string length]}.

The maximum string length you can generate is 1024 characters.

Generate random strings based on the time stamp

You can generate random strings that are based on the current time stamp. The system uses the time stamp to generate the value, but the actual time stamp is not part of the string.

The string consists of 16 random numbers and characters.

To create the string, use the syntax {CTMSTMP}.

Was this information helpful?

Tricentis RPA Studio Manual 2020.2 © Tricentis GmbH