How to get min number

hello,

i have page where prices for food items are listed .
i am extracting using extract data table and saving in variable extractdatatable.
then i am using loop to get one by one value using for each row in datatable.
u can see in image 6.95,5.95 …like prices are there.

my requirement is to find minimum price which is 5.95 from all values.
how can i find that minimum price from whole data?

Hi @Mathkar_kunal

Please refer below post.

There are various approaches defined in below post.

Hope this helps.

You can use linq query to apply Min fucntion on the column in datatable

Hi Kunal,

assuming your datatable is extractdatatable and column name is prices,
create new variable minPrice of double datatype and in assign activity paste this Linq query. thats it :slight_smile: no need of looping & all you will get your required value

extractdatatable.AsEnumerable().Min(Function(row) Convert.ToDouble(row(“prices”)))

hope this helps.

Happy Automation!

1 Like

If this solves your query. please mark this as solution & close the topic :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.