I have a script running automatically when the USD balance of my expense sheet is changed. It updates the balance column to track expenses.
// change these names to pick a view:
let table = base.getTable('Tangle Treasury Expenses');
let view = table.getView('Grid view');
let result = await view.selectRecordsAsync();
let runningTotal = 0;
for (let record of result.records) {
// change the field names here to adapt this script to your base
runningTotal += record.getCellValue('USD Formula');
await table.updateRecordAsync(record, {
'USD Balance': runningTotal,
});
}
It keeps timing out at 30 seconds. Randomly it successfully completes at 28 seconds but rare.
Any options to fix this?