Docs vs Sheets for storing large amounts of data

26 views
Skip to first unread message

Jacob Edward

unread,
Apr 4, 2019, 6:02:04 PM4/4/19
to Google Apps Script Community
var insertData = []

insertData becomes 

insertData.length == 4895;
insertData[0].length = 5;

doc = DocumentApp.openById(doc);
var body = doc.getBody();
body
.setText(JSON.stringify(insertData));

just never complete's but this spreadsheet function will finish in a few seconds... what?

ss = SpreadsheetApp.openById(ss);
var sheet = ss.getSheets()[0];
var letter = grabLetterColumn(insertData[0].length);
var number = insertData.length;
sheet
.setActiveSelection("A1:"+letter+number).setValues(insertData);

Alan Wells

unread,
Apr 4, 2019, 7:23:06 PM4/4/19
to Google Apps Script Community
Do you think it's because the data in insertData is too big?  Is there an error message?  Did you debug it?

Jacob Edward

unread,
Apr 4, 2019, 8:58:49 PM4/4/19
to google-apps-sc...@googlegroups.com
It being too big is the only thing that makes sense... yes I debugged, I had it giving returns for the entire thing right before

body.setText(JSON.stringify(insertData));

and that's the last line before the regular return "complete";

Also, do you know how to bulk create spreadsheet files?  Just creating them one at a time is ridiculously slow... Right now I've just got a loop on the client side running a 

google.script.run

that's calling a very quick create function but I've got thousands... right now it's got like 50 after a few minutes...

Jacob Edward

unread,
Apr 4, 2019, 9:13:53 PM4/4/19
to Google Apps Script Community
ah well nevermind on that loop... works at first and then nothing but nulls... lol wtf, data is fine, GAS just fails randomly

On Thursday, April 4, 2019 at 4:23:06 PM UTC-7, aj.addons wrote:

Jacob Edward

unread,
Apr 4, 2019, 9:29:10 PM4/4/19
to Google Apps Script Community
oh lol, quota is only 250 a day... well that's a relief...
thought I would just have random fails without being able to jig it...


On Thursday, April 4, 2019 at 4:23:06 PM UTC-7, aj.addons wrote:
Reply all
Reply to author
Forward
0 new messages