Here are the examples of how you can use the Math Functions from Dynamic Content in a Power Automate Flow –
In this example, I’ll use the below Inputs to perform the Math Operations on and I’ll have the Math Functions perform in the Example of the functions shown below –
Minimum gives out the smallest value in the Array of numbers.
- Here, I’ve created an array of numbers and from this, I’m selecting the minimum value.
- And the result is as below –
Inversely as the Min() function above, the Max function will return the highest number from the Array or Collection –
- Here’s how I use the Max function –
- And the result of the Max function is as below –
As it suggests, this is the addition function which will add the 2 numbers provided as arguments –
- In the variable, I’ll look for add and enter the 2 arguments from the Manual Trigger i.e. passing values while running the Flow.
And as you can see below, I’m using add() function and passing the parameters separated by a comma.
- Then, I’m passing the below arguments when I run the Flow.
- And then I run the Flow, the result is as below –
As the function suggests, you can subtract number 2 from number 1. Here’s an example –
- In the below Sub() function, I can see
- And when I pass the below arguments 20 and 5 –
- And the result will be 20 – 5 = 15.
Rand() function will give out a random number from the collection at each run. Hence, the result will vary on each run –
- I’m providing the start number range and the end number range. And the function will select the a random number from within the range –
- So, when I run it for the first time, I’ll get a number
- And when I run it one more time, I’ll get a different number.
Mul() function will multiple the 2 numbers passed in the arguments –
- I’m passing the 2 arguments within the function itself like I did for some of the above functions.
- And the result will be as follows –
Div function will divide the first number by the second one –
- In this example, I’m providing the
- And the result in this case is 25.
Mod() function will give the modulo / modulus or the division happening between the dividend and the divisor i.e. you’ll get the remainder value –
- I’m supplying the below parameters which will give a modulus.
- And the result obtained is the remainder of the division –
Range() function will generate a range between –
- The 2 arguments required by range() function are startIndex and count. Count meaning how many numbers you want in the array.
Notice the type of the variable has been changed to an Array now.
- And the result is the below Array with 6 items in the Array starting from value 2.
Hope this was useful!
Here are some Power Automate posts you want to check out –
- Select the item based on a key value using Filter Array in Power Automate
- Select values from an array using Select action in a Power Automate Flow
- Blocking Attachment Extensions in Dynamics 365 CRM
- Upgrade Dataverse for Teams Environment to Dataverse Environment
- Showing Sandbox or Non Production Apps in Power App mobile app
- Create a Power Apps Per User Plan Trial | Dataverse environment
- Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
- Co-presence in Power Automate | Multiple users working on a Flow
- Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
- Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
- Call a Flow from Canvas Power App and get back response | Power Platform\
- FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
- Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
- Asynchronous HTTP Response from a Flow | Power Automate
- Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
- Converting JSON to XML and XML to JSON in a Flow | Power Automate
2 thoughts on “Math Functions examples in Power Automate Flow”
Thanks. Very useful.
LikeLiked by 1 person
I’m happy it’s useful for you.