Using google-apps-script from google spreadsheet, I am trying to extract several hundred rows of data using fetchUrl and paste them into my sheet using sheet.appendRow.
Getting data and dividing into arrays is fine. But when you add them to lines, line by line sometimes occurs without errors and leads to empty lines.
Here is a pretty simple example to recreate the problem.
function appendTest() { var sSheet = SpreadsheetApp.getActiveSpreadsheet(); sheet = SpreadsheetApp.setActiveSheet(sSheet.getSheets()[2]); for (var i = 0; i <= 100; i++) { sheet.appendRow([i, 1, 2, 3, 4, 5]); } }
About 5 or 10 lines, from time to time, becomes empty. The Utilities.sleep () insert also does not work.
Does anyone have any ideas to get rid of this situation? Thank you in advance.
source share