Power Automate (WDL) function
mod — Power Automate (WDL) function reference
Remainder after division.
Syntax
wdl
mod(dividend, divisor)
Examples
wdl
mod(17, 5)
→ 2
A common pattern for alternating logic or batching every other item.
wdl
equals(mod(variables('rowNumber'), 2), 0)→ true / false
wdl
equals(mod(item()?['Index'], 100), 0)
→ true every 100th item — useful for a periodic checkpoint
Common mistakes & gotchas
- mod() by zero throws the same as div() by zero — validate the divisor first.
- The result takes the sign of the dividend for negative numbers, so mod(-7, 3) returns -1, not 2, which differs from the mathematical modulo some people expect.
Related Workflow Definition Language functions
From Math