Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8875285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:56:22+00:00 2026-06-14T18:56:22+00:00

Using google-apps-script from google-spreadsheet, I’m trying to fetch some hundreds of rows of data

  • 0

Using google-apps-script from google-spreadsheet, I’m trying to fetch some hundreds of rows of data using fetchUrl and paste them into my sheet using sheet.appendRow.

Fetching data and splitting to arrays are OK. But appending them to a sheet row by row ocasionally fails without any errors and resulting in empty rows.

Here’s quite 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 rows, differs time to time, become empty.
Inserting Utilities.sleep() seems to be not working, either.

Does anybody have any idea to get rid of this situation?
Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:56:24+00:00Added an answer on June 14, 2026 at 6:56 pm

    You could try to use batch writing to the sheet like this

    function appendTest() {
      var target = new Array()
      var sSheet = SpreadsheetApp.getActiveSpreadsheet();
      sheet = SpreadsheetApp.setActiveSheet(sSheet.getSheets()[2]);
      for (var i = 0; i <= 100; i++) {
          target.push(['some data','in some columns','bla bla']);
      }
    sheet.getRange(sSheet.getLastRow()+1,1,target.length,target[0].length).setValues(target);
    }
    

    Note that if you think the sheet will be too ‘short’ you could append empty rows in the loop as well.

    EDIT : following Michael pertinent answer, it would be a much better idea to add the necessary rows using sheet.insertRowsAfter(sheet.getMaxRows(), target.length)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Google Apps Script, I've made a UI for use on a Google Spreadsheet.
I'm trying to query the goo.gl API from inside a Google Apps Script. The
I want to read some simple parameters from a Google Drive Spreadsheet using Google
I have customised a menu in Google Spreadsheet using Google Apps Script. The problem
I am trying to save some user input from a Google App Script form
Using Google Apps Script. I know it is not a programming issue, but got
SETUP: Using Google Apps Script's UI (doGet) with tabPanel option. At the bottom of
Has anyone found support for creating or changing a drawing using Google Apps Script?
As described here: https://developers.google.com/apps-script/html_service#GoogleScriptAPI I am using a little form in my google app
I'm new to Google Apps Script. I'm working my way through some simple example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.