# Power Automate: min Function

TheÂ min Function finds in an array of numbers the lowest number. Quite simple and handy.

## Usage

It follows a simple pattern.

1. An array of numbers (integer or float)

Example:

``````Array called 'NUMBERS' with the following elements:
[2,4,3,1,6,8,9,10,1,22,214,55,3,2,1]

min(variables('NUMBERS'))

will return

1
``````

Quite straightforward, right?

``````Array called 'NUMBERS' with the following elements:
[2,4.2,3,0.2,1,6,8,9,10,1,22,214,55,3,2,1]

min(variables('NUMBERS'))

will return

0.2
``````

Works perfectly even if you mix them in the same array.

If you want to create the array directly in the function you can do the following:

``````min(createArray(1,2,3))

and it will return

1
``````

## Limitations

There are no documented limitations. I tried to do a min on an array with 200K numbers and it didnâ€™t seem to delay the Power Automateâ€™s execution time, so I think you should be ok on your day-to-day arrays.

## Recommendations:

1. Donâ€™t create the array inside the function. Always use variables to make the Power Automate more readable and separate the responsibilities.
2. Use a Compose with the function. I know that this is wasteful, but you can see if the value returned is the one youâ€™re expecting and not another value. If you perform it inside a formula you may have difficulty debuting it, since youâ€™re never sure of the value that comes out of the min.
3. Donâ€™t nest it. Thereâ€™s no real reason to do it but if you find yourself in a situation where you have nested min functions in a formula, you should review it and make everything more straightforward.

## Sources:

Microsoftâ€™s min Function Reference

Back to the Power Automate Function Reference.

Photo by Uriel Soberanes on Unsplash

#### Manuel Gomes

I'm a previous Project Manager, and Developer now focused on delivering quality articles and projects here on the site. I've worked in the past for companies like Bayer, Sybase (now SAP), and Pestana Hotel Group and using that knowledge to help you automate your daily tasks

View all posts by Manuel Gomes →