find the biggest number from all results
Status: Closed · Asked by elhanan cohen on · 0 views
Hi! I export all records from Airtable and I want get the the largest number
Hey @elhanan cohen
Can you please share the workflow URL in which you are trying the same to get the latest record number?
Please check your third step we have added a JS code action step to get the latest record, I hope this might help you out.
Thanks! working!
const jsonData =
[All records]
// Extracting the "counter" values from the JSON data and finding the largest number
const largestCounter = jsonData.reduce((max, item) => {
const counter = item.fields["counter"];
return counter > max ? counter : max;
}, -Infinity);
console.log("The largest number in the 'counter' field is:", largestCounter);