See also: Random long value
Value resolver – Abstract
Purpose: Returns a random text token (
String) as a hexadecimal representation of a randomLongvalue.Tooltip
Usage: The value resolver ignores the input value. It returns on the server side the
base36representation of a randomLongvalue, i.e. a combination of up to 13 digits or lowercase letters, possibly preceded by a minus sign.Note: Depending on the
Longvalue determined as a pseudo-random number, the text length of the supplied text token is between 1 and 14 characters. Different requirements for the length of the text token require specific configuration effort (see documentation for examples).Warning: In the client context, only the lowest 52 of the 64 bits from the
Longvalue are considered, so only integers ≥0 (from the interval[0;2^52[)are returned. Therefore, a text token generated by a Client Workflow never starts with a minus sign and only reaches a maximum length of 11 characters.

The Random text token value resolver returns a random text token (String).
The generated text token is the base36 image of a random Long value, i.e., on the server side, the hexadecimal representation of a 64-bit integer whose most significant bit defines the sign.
For the arbitrarily named text token in the return value (String) this means specifically:
The string starts with a minus sign in approx. 50% of the cases. For positive values, no plus sign is prefixed.
Since the
base36digit sequence does not use 'leading zeros' for the absolute amount, a base36 digit (definition as a regular expression:[0-9a-z])must appear as the first character after the prefixed minus, if any.Depending on the absolute value of the internally 'cubed'
Longvalue, this is followed by up to 12 furtherbase36digits ([0-9a-z]).The length of the returned text token can theoretically be between 1 and 14 characters due to the value range for
Long, where 14 characters is only reached with the preceding minus.
Even if the return value produces strings of 10 or more characters with high probability, the random occurrence of shorter strings at runtime should not be neglected across the board.
â–ºIMPORTANTâ—„ In a Client Workflow, only the lowest 52-bits of the random Long value are processed. The higher value bits are ignored or truncated. This also includes the sign bit (No. 64)! The value range in the Client Workflow is therefore limited to integers in the interval [0;2^52[. A text token generated via a Client Workflow therefore never starts with a minus sign and also only reaches a maximum length of 11 characters.
â–ºNOTEâ—„ If a minimum text length (>1 character) is absolutely necessary for the random text, this must be systematically enforced by further measures. The examples (below) demonstrate with two differently elaborate approaches how this can be achieved.
Configuration
The Random text token value resolver ignores the input value and does not use any parameters.
Examples
Random text token with exactly 14 characters
The following configuration assigns a random sequence of digits and lowercase letters with a length of 14 characters to the variable token:

The value configuration on the right side of the Set value event action defines the assigned text value in three steps:
The first substring within the Concat strings value resolver is 'cubed' with the Random text token value resolver.
The Concat strings value resolver attaches a statically defined string of 13 zeros as the second substring.
The concatenated Substring value resolver returns only the first 14 characters of the concatenated string.
The attached zeros compensate for the fact that the Random text token value resolver can provide less than 14 characters.
â–ºNOTEâ—„ Because the Random text token value resolver reaches a text length only with return values that start with a minus sign, the 'prepared' token with this configuration always ends with the character '0' if it does not start with a minus sign.
Random text token with arbitrary length
In an event handler, a random text token with 50 characters is to be reliably generated and assigned to the token variable.
The configuration shown on the right for a For each loop event action, accesses the Random text token value resolver up to 50 times to assign a sufficiently long string to the â–ºNOTEâ—„ The variable token should be assigned 'No value' ( The following steps are executed in the action block for iteration:
â–ºNOTEâ—„ With multiple access to the |
|

