google apps script - batch setValues() on Sheet
问题 In order to optimize my code, I'm trying to do the batch updates. Instead of calling setValues() on the loop, I want to store the data in an array, then do an setValues() once after the loop. However, I can't make it work: var tempValuesArr= []; var ctr = 0; for ....{ //there is only one row needed for every second sheet, get the data at the 2nd //row with 6 columns var secondSheetRange = secondSheet.getRange(2, 1, 1, 6); tempValuesArr.push(secondSheetRange.getValues()); ctr++; } //finally,