Free cookie consent management tool by TermsFeed

a!rand() Function

On This Page

Returns a random number between 0 and 1 based on an even probability distribution. The result changes every time the expression is evaluated.

Parameters

a!rand( count )

Keyword Type Description

count

Number (Integer)

The number of random numbers to be returned. Defaults to 1 when not specified.

Returns

Number (Decimal Precise)

Using the function

The following sections cover important details about the a!rand() function.

Randomize results across simultaneous transactions

If multiple transactions take place at the same time, the following expression can be used to further randomize the result:

1
2
3
4
a!toDecimal(
  value: text(a!rand() * (10^6), "000000"),
  decimalType: "PRECISE"
)

Using the count parameter

The maximum value for the count parameter is 1,000,000.

Examples

The following examples demonstrate the a!rand() function.

To experiment with examples, copy and paste the expression into an expression rule and click TEST RULE to see the output.

a!rand() returns 0.117353796273227

a!rand(2) returns {0.2174863770951757, 0.2119221472707865}

Old versions

There are older versions of this function . You can identify older versions by looking at the name to see if there is a version suffix. If you are using an old version, be sure to refer to the corresponding documentation from the list below.

Old Versions Reason for Update
rand_26r9

Returns values as type Number (Decimal Precise) instead of floating decimals.

To use the latest version of the function, replace the function with a version suffix with a new function reference.

To learn more about how Appian handles this kind of versioning, see the Function and Component Versions page.

Feedback