Relative Content

Tag Archive for javascriptarraysgoogle-sheetsgoogle-apps-scriptgoogle-sheets-api

Manual control of SpreadsheetApp.flush()

I’ve written an Apps Scriptfunction, func() that moves data within multiple sheets, however Apps Script is bundling the operations in a way not optimal for user experience. Essentially what happens is that it is bundling all of thesetValue() operations up until the third sheet.getrange() call, in this case sheet3.getRalgeList.getRange(). I noticed this in testing by undoing the script operation and observing that more than one undo in google sheets is required to revert the changes. I want only one undo to be required to undo all changes brought on by this function. Calling SpreadsheetApp.flush() at the end does not resolve this issue. I’ve written other similar functions for my sheet and have never seen this issue before.