Use the random helper to generate random strings or numeric sequences. The first argument specifies the generation method—"crypto" or "uuid"—while the second (optional) argument specifies the output length. If no length is provided, the max length is 32 characters.
Warning: {{random "number" n}} currently returns an alphanumeric string instead of a numeric-only string. As a workaround:
- NetSuite SuiteBundle / SuiteApp 1.0: Use uppercase "NUMBER" — for example, {{random "NUMBER" 9}}.
- All other services (including SuiteApp 2.0): Use {{{substring (join "" (reverse (timestamp "x" "UTC")) (timestamp "x" "UTC")) 0 18}}} to produce an 18-digit numeric string.
Tips:
- Use "crypto" when you need an alphanumeric string with higher randomness (e.g., quick tokens or IDs).
- "uuid" returns a shorter alphanumeric sequence intended for unique but less structured identifiers.
- If you omit the length argument, a 32-character (or digit) result is returned by default.
{{random "crypto" length}} {{random "uuid" length}}
- "crypto" returns a random alphanumeric string of the specified length, using a cryptographic approach.
- "uuid" returns a shorter alphanumeric string resembling a UUID fragment (though not a standard RFC-4122 UUID).
-
length is an integer controlling how many characters (or digits) to generate. The default is
32, and values outside of 1-32 also fall back to 32.