cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ursNani
Helper IV
Helper IV

Get Max Number from array Variable

Hi 

I am creating a flow that need to find max number from the SharePoint list .

I can get Array of all the numbers but how to identify Max number . Please find the attachment 

 

Also tried like :  MAX(Output(VarMax)), but it getting error . Please help me 

Array .jpg

1 REPLY 1
Sundeep_Malik
Community Champion
Community Champion

Hey @ursNani 

 

The reason you are getting an error is because the values you are getting are of string data type. And max expects its input to be of integer or float type.

 

So try this:

In compose 1 I have added your data.

Then in Select, I have passed output of compose and I have used this expression 

int(item())
To convert all the items to integer type, you can also use float(item())
At the end using max function on the body of the select: max(body('Select'))

Sundeep_Malik_0-1670401804840.png

Output:

Sundeep_Malik_2-1670401940527.png

 

 

Sundeep_Malik_1-1670401930462.png

 

 

To get the Select action like me just click on that:

Sundeep_Malik_3-1670401996880.png

I hope this helps 🙂

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (5,106)