range - TypeError: Cannot call method "getRange" of null. (line 3, file "Code") -


for reason can't range in code read script have written. have setup if statement return "yes" in given range, if question on form answer c, way have setup returning error saying can't read range.

please advise!

function onformsubmit() {   var sheet = spreadsheetapp.getactivespreadsheet().getsheetbyname("original submissions");   var lastrownumber = sheet.getdatarange().getnumrows();   var cellvalue = sheet.getrange(lastrownumber, 28).getvalue();   if (cellvalue == "yes") {       mailapp.sendemail("gmail@gmail.com","special graduation requirement","visit " + sheet.geturl() + "to process request.");   } } 


Comments

Popular posts from this blog

javascript - three.js lot of meshes optimization -

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -