Power Automate (WDL) function
rand — Power Automate (WDL) function reference
Random integer in a range.
Syntax
wdl
rand(minValue, maxValue)
Examples
wdl
rand(1, 100)
→ e.g. 42
wdl
rand(1000, 9999)
→ A random 4-digit number
wdl
concat('TICKET-', string(rand(100000, 999999)))→ e.g. "TICKET-482913"
Common mistakes & gotchas
- Upper bound is exclusive.
- maxValue is exclusive, so rand(1, 100) can return 1 through 99, never 100 — easy to miss when you want a "1 to 100 inclusive" range.
- Not cryptographically secure — use guid() instead for anything security-sensitive like a reset token.
Related Workflow Definition Language functions
From Math