Returns a random number within a defined range.
Availability
<table> <tr> <td>Marketing Cloud Engagement</td> <td>✅ Yes</td> </tr> <tr> <td>Marketing Cloud Next</td> <td>✅ Yes</td> </tr> </table>This function became available in Marketing Cloud Next during the Summer ’26 release (API version 67.0).
Syntax
Random(lowerBound, upperBound)
The Random() function has two parameters:
lowerBound(number): Required. The smallest number that the function can return.upperBound(number): Required. The largest number that the function can return.
Usage
To use this function, pass it a lower and an upper bound. The numbers can be positive or negative integer or decimal numbers. The order of the upperBound and lowerBound parameters in the function doesn’t matter.
%%=Random(42,32256)=%%
The function returns a random number that is greater than or equal to the smallest number, and less than or equal to the largest number.