Home > Enterprise >  What's the cell limit of the importdata function in Google Sheets?
What's the cell limit of the importdata function in Google Sheets?

Time:11-04

I'm trying to import a .csv file into a Google Sheet, but keep getting the message "Error Resource at url contents exceeded maximum size.". When manually importing, I get 8498 rows and 112 columns. When looking on forums, other users mentioned 2 million cells, which is more than double of the cells this import contains. Is there a workaround?

CodePudding user response:

Try to replace importdata by this function

function importCsvFromIdv1() {
  var id = '_______id du fichier____________';
  var csv = DriveApp.getFileById(id).getBlob().getDataAsString();
  var csvData = Utilities.parseCsv(csv);
  var sh = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("mySheet");
  sh.getRange(1, 1, csvData.length, csvData[0].length).setValues(csvData);
}

CodePudding user response:

in most cases you dont need whole importdata, just some part of it. if so, try:

=ARRAY_CONSTRAIN(IMPORTDATA("url"); 5000; 20)

or:

=QUERY(FLATTEN(IMPORTDATA("url")); "where Col1 is not null")
  • Related