Math Functions examples in Power Automate Flow

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 –

Min()

Minimum gives out the smallest value in the Array of numbers.

  1. Here, I’ve created an array of numbers and from this, I’m selecting the minimum value.

  2. And the result is as below –


Max()

Inversely as the Min() function above, the Max function will return the highest number from the Array or Collection –

  1. Here’s how I use the Max function –

  2. And the result of the Max function is as below –

Add()

As it suggests, this is the addition function which will add the 2 numbers provided as arguments –

  1. 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.

  2. Then, I’m passing the below arguments when I run the Flow.

  3. And then I run the Flow, the result is as below –

Sub()

As the function suggests, you can subtract number 2 from number 1. Here’s an example –

  1. In the below Sub() function, I can see

  2. And when I pass the below arguments 20 and 5 –

  3. And the result will be 20 – 5 = 15.

Rand()

Rand() function will give out a random number from the collection at each run. Hence, the result will vary on each run –

  1. 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 –

  2. So, when I run it for the first time, I’ll get a number

  3. And when I run it one more time, I’ll get a different number.

Mul()

Mul() function will multiple the 2 numbers passed in the arguments –

  1. I’m passing the 2 arguments within the function itself like I did for some of the above functions.

  2. And the result will be as follows –

Div()

Div function will divide the first number by the second one –

  1. In this example, I’m providing the

  2. And the result in this case is 25.

Mod()

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 –

  1. I’m supplying the below parameters which will give a modulus.

  2. And the result obtained is the remainder of the division –

Range()

Range() function will generate a range between –

  1. 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.

  2. 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 –

  1. Select the item based on a key value using Filter Array in Power Automate
  2. Select values from an array using Select action in a Power Automate Flow
  3. Blocking Attachment Extensions in Dynamics 365 CRM
  4. Upgrade Dataverse for Teams Environment to Dataverse Environment
  5. Showing Sandbox or Non Production Apps in Power App mobile app
  6. Create a Power Apps Per User Plan Trial | Dataverse environment
  7. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  8. Co-presence in Power Automate | Multiple users working on a Flow
  9. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  10. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  11. Call a Flow from Canvas Power App and get back response | Power Platform\
  12. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  13. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  14. Asynchronous HTTP Response from a Flow | Power Automate
  15. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  16. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!