Power Automate (WDL) function
add / sub — Power Automate (WDL) function reference
Add or subtract.
Syntax
wdl
add(summand1, summand2) / sub(minuend, subtrahend)
Examples
wdl
add(variables('total'), 5)→ A number
wdl
sub(variables('stockOnHand'), triggerBody()?['QuantityOrdered'])→ Remaining stock after the order
wdl
add(int(item()?['BasePrice']), int(item()?['Tax']))
→ The total including tax
Common mistakes & gotchas
- Both are strictly two-argument functions — add(a, b, c) is invalid, unlike and()/or()/coalesce(); chain calls (add(add(a,b),c)) for more than two values.
- Numeric strings are implicitly parsed, but a non-numeric string throws rather than being treated as 0.
Related Workflow Definition Language functions
From Math