Question

I've created a Google spreadsheet with imported data on one cell, extracting specific string to another cell and pasting the data in a table with a trigger for every 2 hours. Now everything works perfectly when running the script manually but when logged out and waiting for the cells to fill, sometimes the pasted cell getting "#N/A" value. Here is the code I'm using:

function PasteV(){
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[0];
  var timestamp= sheet.getRange("D1").getValue();
  var sale= sheet.getRange("G1").getValue();
  var rent= sheet.getRange("J1").getValue();
  sheet.appendRow([timestamp, rent, sale]);
}

Again when running manually countless times - no problem. I'll appreciate your help. Thanks.

Was it helpful?

Solution

#N/A is caused by using a custom function. There is an issue for it on the google-apps-script issue tracker, see https://code.google.com/p/google-apps-script-issues/issues/detail?id=1131

Sounds like the same bug, your description sounds the same.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top