How to find the smallest and largest number from a list of number?

 If you have stored those values as string then you can use below script :


var x= "1,22,8,3,4,5,6"; //(This is list of numbers which i found from gliderecord and output is same as in variable x)

var array = x.split(",");

var min = Math.min.apply(null,array);

gs.print(min);

var max=Math.max.apply(null, array)

gs.print(max);

If you have stored those values as array of numbers then you can use below script :


var array = [1,22,8,3,4,5,6]; //(This is list of numbers which i found from gliderecord and output is same as in variable x)

var min = Math.min.apply(null,array);

gs.print(min);

var max=Math.max.apply(null, array)

gs.print(max);

Let me know i

Snow PDF

 ServiceNow PDF Try it Yourself » < iframe  src ="https://drive.google.com/drive/folders/1MHcrQb2TJTQtU8zyYZN1koJn5mD3r6YZ?usp=shari...