2

One of my scripts is a leave approval system.

It reads a spreadsheet of all leave requests ever submitted, loading all data into an array.

This array is then processed and displayed in a dynamic grid.

The way this is designed, all leave requests need to be in a single sheet. Even once requests are approved, employees can view their current and past requests through this script.

Over time this will grow into thousands of lines. Each line is ~140 bytes.

I can't find any reference to a maximum array size in Apps Script.

I suppose I may hit execution time limits before I exceed the size of the structure anyway!

Does anyone know if there is a limit, and what it is?

Tony

  DataSource = SpreadsheetApp.openById("0AgHhFhurd2nCdFV4dmdRS3....");
  DataSheet = DataSource.setActiveSheet(DataSource.getSheets()[0]);

  var numRows = DataSheet.getLastRow()-1;  // -1 to omit header row
  var LeaveData = DataSheet.getRange(2, 1, numRows, 16).getValues();
Rubén
  • 34,714
  • 9
  • 70
  • 166
Tony
  • 43
  • 1
  • 5
  • Presumably, the language limit would be 4.29 billion elements http://stackoverflow.com/questions/6154989/maximum-size-of-an-array-in-javascript but you are likely to meet a few other operational limits along the way to that – DavidF Nov 04 '13 at 01:07
  • Thanks David, should have thought to search for limits in the underlying Java Script language :-) – Tony Nov 04 '13 at 03:53
  • I have also seen other posts talking about multiple 6000 line arrays, so looks like I will be okay. – Tony Nov 04 '13 at 03:53
  • 1
    I have one spreadsheet which is a view on a about 10,000 records. These 10,000 records are held in one text file which is loaded into g apps script as JSON. I use .setValues(viewArray) to put a selection of these records into a single sheet. viewArray is about 9 columns wide. I have NOT been able to .setValues(viewArray) where viewArray.length is greater than about 3200. I can, in the same function, perform setValue twice into 2 sheets, so as to have more records. This has suited me fine - I have not tried if .setValues performed twice into the same sheet would work. YMMV – David Tew Nov 04 '13 at 09:33

0 Answers0