I'm importing data from one sheet to another sheet using Google Appscript. However when I run the code there's an error occuring.
function importdata() {
var mainfile = SpreadsheetApp.getActive().getSheetByName('Data1');
var secondfile = SpreadsheetApp.openById('1232131231231abcc').getSheetByName('RAW');
var datas = secondfile.getRange('C:C').getValues();
var paste = mainfile.getRange('A:A').setValues(datas);
}
Message details
Exception: The number of rows in the data does not match the number of rows in the range. The data has 27441 but the range has 27509. (line 6, file "Code")