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
Return the minimum element from a set of numbers or an array.
min(<number1>, <number2>, ...)
- <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.
- 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.
Create a new flow with trigger ‘Manually trigger a 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 Array, 3) Set value to ‘[2,1,7,3,9,4]’
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 ‘min(variables(‘myNumbers’))’, 4) click on ‘OK’
Setup min expression in Power Automate
Save and do a test run
Result test run – Power Automate Min function example