Hi, I have 2 functions and I want one to run after another with some delay in between runs,
when I run each code separately it works fine, the code is short and it takes a second to run. on the EXECUTION page, it shows "completed". after each run /by the trigger.
there is a trigger based on form submit.
I put the functions in one file, when the form submitted, both functions run OK, one after another but on the EXECUTION page, it shows "running" under status.
even if do one or more forms submit, the new task "running" appears, and the old one still there, it/they won't disappear unless I refresh the EXECUTION page.
I have changed my actual functions and tested with a simple math function, to see if my functions caused the problem, and used the following codes, the result was the same, the functions work but the "running" status won't disappear.
Why the codes or one code keep running?
Does anyone know how to fix this, please?
if the method below is not right, please help me with how to run 2 or more functions in one file one after another with some delay in between, when the form submits.
I appreciate your help.
function AutoMa() {
a();
Utilities.sleep(3000)
b();
};
function a() {
var a = parseInt('4');
var b = parseInt('3');
Logger.log(a + b);
}
function b() {
var a = parseInt('44');
var b = parseInt('33');
Logger.log(a + b);
}