0

Following my previous post where I was trying to export my JSON data to a Google Sheet, I now have an issue with my output being truncated. Basically my Google sheet will only displays 100 rows at a time.

When I enter console.log(jsonData);, The console gives me the following message: Logging output too large. Truncating output.

I believe I need the output to be put inside a loop in order to load all the elements.

If anyone knows how to do this in Apps Script, I would be very grateful.

Edit: The message I receive from the console is not an error, it's just a notice from Google Apps script. I need to find how can I log the entire output of my response in my script, so all my data can be exported and not only the first 100 rows.

Damien
  • 143
  • 1
  • 10
  • From your question, in that case, how about exporting the data as a text file? In this case, how about putting `DriveApp.createFile("sample.txt", response.getContentText())` after the line of `UrlFetchApp.fetch`? By this, you can see a text file in the root folder. If I misunderstood your question, I apologize. – Tanaike Aug 24 '22 at 08:55
  • @Tanaike, Sorry, let me reformulate my question. Because `Logging output too large. Truncating output.` then my Google sheet will export only what is displayed in the console (only 100 rows). My issue is the same as this person: https://stackoverflow.com/questions/65444065/google-apps-script-json-to-spreadsheet-result-too-long-api-to-sheet-work-on but my Javascript expertise is too low, so I cannot adapt this to my script, sorry about that ... – Damien Aug 24 '22 at 09:17
  • 1
    If you just want to see what the jsonData is, if its a string, split it on '{' or some other character, convert to a 2D array and then setValues() to some place on a sheet. Just because the console or Logger can't handle a large number of lines doesn't mean its not there. – TheWizEd Aug 24 '22 at 15:25
  • As the duplicate says, export the text to drive, if you want. As TheWizEd says, data is actually present in memory and you can export it to drive or a Google sheet. – TheMaster Aug 24 '22 at 15:35

0 Answers0