To get the min value for a field (I’m assuming this is a number field) you can do this:

let table = base.getTable('Scores');
let query = await table.selectRecordsAsync();
let min = query.records.reduce((prev, curr) => prev.getCellValue('Score') <= curr.getCellValue('Score') ? prev : curr);
console.log(min.getCellValue('Score'))
Here, we use a reduce
method to iterate through the records returned by the query. We define the min
record to be the result of the reduce function, which, at each step, passes to the next step the previous iteration record if that is less than the current record or the current record if that is less than the previous record.
In my example data set, the result returned is “2” (from the “B” record). Note that it does not return the “E” record as this is not less than B.
@JonathanBowen Reading the original post, it looks like @Shubha_Bala wants more than just the lowest value (emphasis added by me):
To do that would require another line after the min
calculation:
let allMin = query.records.filter(record => record.getCellValue("Score") == min.getCellValue("Score"));