The Power Automate Div function, also known as integer division, divides the dividend by the divisor and returns the quotient as an integer.
It discards any remainder and rounds down to the nearest whole number. For example, div(7, 3) would return 2, and div(8, 3) would also return 2.
In this article, I’ll introduce you to the div function and will provide a step-by-step guide on how to use the function in a Microsoft flow.
Power Automate Div Function
Divide two numbers and return the quotient. Use the mod() function to obtain the remainder.
Syntax
div(<dividend>, <divisor>)
Input parameters
- dividend (mandatory): The number that will be divided by the divisor.
- divisor (mandatory): The number that will divide the dividend, but must not be zero.
Return value
- Returns the quotient of the first number divided by the second number, in floating-point if either the dividend or divisor is a float.
Power Automate Div Expression Example
div(9,3)
=> 3
div(8,3)
=> 2
// float example
div(5.5,1.5)
=> 3.6666666666666665
// with variable
div(variables(‘myNumber’), 3)
How To Use The Power Automate Div Function
Follow the steps to use the Power Automate Div function in a flow.
-
Create a new flow with trigger ‘Manually trigger a flow’
New flow
-
Add a new step by clicking on ‘+ New step’
Add a new step
-
Search for ‘initialize’ and click on ‘Initialize variable’
Add Initialize variable action
-
Setup Initialize variable: 1) Provide a name, 2) select type Integer, 3) Set value to ‘9’
Setup variable
-
Add a compose step by searching for ‘compose’ and clicking on ‘Compose’
Add Compose action
-
Setup compose action: 1) click into Inputs (popup appears), 2) click on ‘Expressions’, 3) set expression to ‘div(variables(‘myNumber’), 3)’ 4) click on ‘OK’
Setup div expression in Power Automate
-
Save and do a test run
Result test run – Power Automate Div function example