Power Automate Min Function Explained

Power Automate Min Function

The Power Automate Min function lets you find the minimum value within a collection.

Its counterpart is the max function that lets you find the maximum value within a collection.

In this article, I’ll introduce you to the min function and will provide a step-by-step guide on how to use the function in a Microsoft flow.

Power Automate Min Function

power automate min expression
min function in Power Automate

Return the minimum element from a set of numbers or an array.

Syntax

min(<number1>, <number2>, ...)

Input parameters

  • <number1>, <number2>, … (mandatory): The set of numbers from which you desire the smallest value.
  • [<number1>, <number2>, …]: The array of numbers from which you desire the smallest value.

Return value

  • Returns the smallest number in the given set or array.

Power Automate Min Expression Example

min(2,1,7,3,9,4)
=> 1

min(variables('myNumbers')) // myNumbers = [2,1,7,3,9,4]
=> 1

min(createArray(3,0,4,2))
=> 0

How To Use The Power Automate Min Function

Follow the steps to use the Power Automate Min function in a flow.

  1. Create a new flow with trigger ‘Manually trigger a flow’

    power automate min new flow

    New flow

  2. Add a new step by clicking on ‘+ New step’

    power automate min new step

    Add a new step

  3. Search for ‘initialize’ and click on ‘Initialize variable’

    power automate min add initialize

    Add Initialize variable action

  4. Setup Initialize variable: 1) Provide a name, 2) select type Array, 3) Set value to ‘[2,1,7,3,9,4]’

    power automate min setup initialize variable

    Setup variable

  5. Add a compose step by searching for ‘compose’ and clicking on ‘Compose’

    power automate min add compose

    Add Compose action

  6. Setup compose action: 1) click into Inputs (popup appears), 2) click on ‘Expressions’, 3) set expression to ‘min(variables(‘myNumbers’))’, 4) click on ‘OK’

    power automate min setup compose

    Setup min expression in Power Automate

  7. Save and do a test run

    power automate min expression test run

    Result test run – Power Automate Min function example

Leave a Comment

Your email address will not be published. Required fields are marked *