Function: @[RANDOM]

In the Management Portal at Entitlement Catalog, when you configure a workflow action for a service, you can optionally replace the values in various fields with functions. With the function @[RANDOM((<minvalue>),<maxvalue>)], you can generate a random integer between a specific minimum and maximum.

For example, you can use this function in a service attribute of a service that provides verification code validation during Password Reset or Unlock Account: the function generates a random code, which is stored in the service attribute. You can then use the service attribute to send the code to the user (e.g. via SMS or e-mail), and validate the code via a Provide Verification Code action.

  • The minimum allowed value in the function is 0, maximum is 2147483647. If you specify values that do not fall between these limits, the function doesn't resolve in a value.
  • The <minvalue> argument is optional.
  • You can apply this function in 3 ways:
    • Use @[RANDOM()] to generate a random integer between 0 and 2,147,483,647.
    • Use @[RANDOM(<maxvalue>)] to generate a random integer that is less than the specified maximum value.
    • Use @[RANDOM(<minvalue>, <maxvalue>)] to generate a random integer that is greater than or equal to the specified minimum value and less than the specified maximum value.

If you insert the @RANDOM function from the Create pattern window, the <minvalue> argument is wrapped in additional parentheses (()) to indicate that it is optional:
@[RANDOM((<minvalue>),<maxvalue>)]
You must remove these parentheses to use the argument.
Example:
@[RANDOM(38,42)]