I have a Google sheet which uses an importrange function and has worked for several years. for some reason, it has suddenly started to fail to copy a couple of rows in the middle of other data and is failing to copy the newest records.I have tried deleting and restoring the importrange formula in the destination sheet with the same result.
thinking that it might be related to the amount of data to be imported, I also tried an arrayformula approach but the result is the same.since neither of these worked, I have tried a script to getValues instead of using importrange but again the result is the same.
it's as if the originating data that is missing from the destination sheet is simply not in the originating sheet even though it's clearly visible.to make matters even more confusing, if I try to print the data in question from a highlighted range in the originating sheet, the missing data which is interspersed with data that is successfully copied shows in the print preview but the data at the end of the sheet which does not get copied is missing from the preview. (see attached).
the interspersed data that is missing from the destination file is for records 2006 and 2009. in addition, I am missing the last 6 records (rows) in the destination file which are clearly included in the originating file.I have included screen shots of the originating data, the destination data and the script I am using.hoping someone can help me with this. I've never seen anything like it.
function initializeNewClientOrder() {//this seript replaces importrange functions in the New Client Order Log UI Control V4.8//import the ID Clean worksheet from the Contact Update Log file https://docs.google.con/spreadsheet// define destination filevar destkey = "1J18WSFdP1UpgNQVISCuFaKKb1x-NRgouQUehoMaX3ok"var destsheet = "Import Contact Log New"//open destination filevar destfile = SpreadsheetApp.openByld(destkey) .getSheetByNane (destsheet) ;//define source filevar sourcekey = "1PGS3EQ1ntXNrHONNACDESZ6ASKVFBCUY1nDUUHVO-ek"//var sourcesheet = “ID Clean";var sourcesheet = "test";//open source filevar sourcefile = SpreadsheetApp.openByld(sourcekey).getSheetByName(sourcesheet) ;// define file array for sourcefilevar lastRow = sourcefile.getRange("O1").getValue();//var lastRow = 1852//startrow, firsteol, rowcount, lasteolvar startrow = 2var firstcol = 1var rowcount = lastRow + 1var lastcol = 12//get the data from the source filevar sourcedata = sourcefile.getRange(startrow, firstcol, rowcount, lastcol).getValues()//write the data back to the destination filedestfile.getRange(startron, firstcol, rowcount, lastcol) . setValues(sourcedata) ;}

