Skip to main content

Airtable automation script to sort linked records by date: Earliest to latest


Ricardo11

Hi community, I have set up a trigger that loads a record and passes on linked records values to a script supposed to order those by date from earliest to latest. I'm struggling to get this to work, can anyone advise? Thanks!

const inputConfig = input.config() const linkedRecords = inputConfig.linkedRecords linkedRecords.sort(function(a,b) { var c= new Date(a.date).getTime(); var d= new Date(b.name).getTime(); return c-d; }) output.set("linkedRecords", linkedRecords)

 

0 replies

Be the first to reply!

Reply