find the biggest number from all results

Status
Not open for further replies.
P

Pabblymember11

Guest
Hey @elhanan cohen

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

Pabblymember11

Guest
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);
 
Status
Not open for further replies.
Top