Skip to main content

Running Balance, Cumulative Total Formula from Airtable Developers Page

  • September 5, 2023
  • 0 replies
  • 23 views

Forum|alt.badge.img+8

I found this formula on the Airtable Developers Page

 
// change these names to pick a view:
let table = base.getTable('Invoices');
let view = table.getView('Grid view');
 
let result = await view.selectRecordsAsync({fields: ['Amount']});
let runningTotal = 0;
for (let record of result.records) {
// change the field names here to adapt this script to your base
runningTotal += record.getCellValue('Amount');
await table.updateRecordAsync(record, {
'Running total': runningTotal,
});
}

Has anyone used this? It's not working for me.