create trigger to run every minute in apps script 1

create trigger to run every minute in apps script

function createTrigger() {
  
  // Trigger every 1 minute
  ScriptApp.newTrigger('addNumber')
      .timeBased()
      .everyMinutes(1)
      .create();
}

Here is what the above code is Doing:
1. It creates a function called addNumber() that adds a number to the spreadsheet.
2. It creates a function called createTrigger() that creates a trigger that calls the addNumber() function every minute.
3. It calls the createTrigger() function.

Similar Posts