Posted 22 December 2021, 9:50 am EST
I have a table that I dynamically add data to, I use addRows to makes the sheet longer then insertRows to add extra rows to the table and then use setArray to add in the new data. The resulting table maintains the original formulas but loses the original styling. Am I missing something??
Snippet of code from my application:
const activeTable = sheet.tables.findByName('TABLE NAME');
const dataRange = activeTable.dataRange();
const rowCount = dataRange.rowCount;
const tableLength = table.value.length; // table.value is an array of the extra data I am trying to add
sheet.addRows(sheet.getRowCount(), tableLength - rowCount + 1);
activeTable.insertRows(0, tableLength - rowCount, true);
sheet.setArray(dataRange.row, dataRange.col, table.value, false);