Introduction
In Power Platform, at times we must compare values to identify the minimum number. In Power Automate, min Function can be used quickly to find out min value in the given set of integers/Array.
Step 1
Login to the required Power Apps environment using URL make.powerapps.com by providing username and password and click on Flows on the left-hand side as shown in the below figure.
Step 2
After Step 1, Click on New Flow and select instant cloud flow and provide the trigger as Manually trigger a flow and click on Create as shown in the below figure.
Step 3
After Step 2, name the flow as Min Function and take an initialize variable and name it as Initialize variable - Provide 1st User Age as 25 and provide values
Name: User1Age
Type: Integer
Value: 25
as shown in the below figure.
Step 4
After Step 3, take a parallel branch and take initialize variable and name it as Initialize variable - Initialize variable - Provide 2nd User Age as 34 and provide values as
Name: User2Age
Type : Integer
Value : 34
as shown in the below figure.
Step 5
After Step 4, take compose action and name it as Compose - Min of Integers and use Min function which expects parameters and returns the minimum value in the input array of numbers or set of integers the syntax as follows
min(value_1: array|number, ...)
As
min(variables('User1Age'),variables('User2Age'))
as shown in the below figure.
Step 6
After Step 5, take another parallel branch beside Step 4 and take an initialize variable action and name it as Initialize variable - Cars Speed Array and provide the following values
Name : CarsSpeed
Type : Array
Value : [
50,
45,
34,
67,
29
]
As shown in the below figure.
Step 7
After Step 6, take compose action and name it as Compose - Min Speed in Cars Speed Array and use Min function
As
min(variables('CarsSpeed'))
as shown in the below figure.
Step 8
After Step 7, save and test the flow and observe results with min value that was returned in the set of integers/array as shown in the below figure.
Note
- Make sure to save and run the flow whenever you try expressions.
- Make sure you provide integer values and provide valid array.
Conclusion
In this way, we can use min function in power automate to achieve customer functionality.