1

How to callback in appscript?

function functionOne(x){
  Logger.log("test "+x);
}

function functionTwo(var1,callback){
  callback(var1);
}

functionTwo(2,functionOne);

Seem like it's working but throw some error which is "callback is not a function". Any reason and solution for that?

Poppy
  • 33
  • 5
  • 1.What function are you calling and 2.How are you calling it? – TheMaster Sep 21 '20 at 08:05
  • @TheMaster I want to call first function if I run the second function and I have no idea how to call it. The idea is whenever people submit Google form, it will trigger the first function and also will run the other function as well. – Poppy Sep 21 '20 at 08:27
  • Use "Default parameters": See https://stackoverflow.com/a/63608780 – TheMaster Sep 21 '20 at 09:23
  • 1
    or you can just change the function into variables and call it back it the first function. – Poppy Sep 21 '20 at 13:38

0 Answers0