I have a sheet built that's pulling in data from an XML feed. I have a script written that will then break out that one sheet into several other sheets based on the contents of a particular column. This all works fine.
My problem is that after I pull in the data from XML and before I split it into new sheets, I add some columns, do some formatting, etc. And then when I copy a row (using appendRow()) to the new sheet, I lose the formatting and formulas.
The code I'm using currently Is:
var datarange = template_sheet.getDataRange();
for (var i in dataRange) {
workbook.getSheetByName(dataRange[i][6]).appendRow(dataRange[i]);
}
Is there a way to do what I'm looking for? Or do I need to breakout the original data into separate sheets first, then loop through each sheet and do the formatting/formulas?