I want to input a variable in a cell only if the cell is empty. The if statement, however, does not work. Any advice?
var ss=SpreadsheetApp.getActiveSpreadsh
Try:
function myFunction() { var ss=SpreadsheetApp.getActiveSpreadsheet(); var s=ss.getSheetByName('odpovědi') var lr=s.getLastRow() var ax=s.getRange(lr, 10).getValue(); if(ax == ""){ ax = "foo"; s.getRange(lr, 10).setValue(ax); } }