find the biggest number from all results

Status: Closed · Asked by elhanan cohen on · 0 views

elhanan cohen — Question ·

Hi! I export all records from Airtable and I want get the the largest number

Pabblymember11 — Reply ·

Hey @elhanan cohen

Can you please share the workflow URL in which you are trying the same to get the latest record number?

Pabblymember11 — Reply ·

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.

elhanan cohen — Reply ·

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);

Back to all forum threads · Log in to reply