How To Prevent Triggers Created On Web App Launch?

23 views
Skip to first unread message

K

unread,
Jun 16, 2020, 6:08:45 AM6/16/20
to google-apps-sc...@googlegroups.com
So I have a time-driven triggers created but every time I launch the Web App it creates another triggers. How to prevent it to always create triggers?

Andrew Roberts

unread,
Jun 16, 2020, 6:51:49 AM6/16/20
to google-apps-sc...@googlegroups.com
You can check if the triggers already exist. Use the source function to identify the right one.

On Tue, 16 Jun 2020 at 11:08, K <hso.huma...@gmail.com> wrote:
So I have a time-driven triggers created but every time I launch the Web App it creates another triggers. How to prevent it to always create triggers?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/7a92a4d8-7da3-4bb2-bcce-d78b5daafec7o%40googlegroups.com.

iBO • App Service

unread,
Jun 16, 2020, 5:18:41 PM6/16/20
to google-apps-sc...@googlegroups.com
e.g. 

App.prototype.isTriggerOn = //+
  function ( functionName ) {
    var result = false;
    var self = this;
    this.call( function () {
      return ScriptApp.getProjectTriggers().some( function ( trigger ) {
        if ( trigger.getHandlerFunction() == functionName ) {
          result = true;
          return true;
        }
      } );
    } );
    return result;
  }

call is exponential Backoff function



--

HINWEIS AUF VERTRAULICHKEIT:
Diese E-mail ist vertraulich. Jede unberechtigte Weitergabe, Vervielfältigung oder Verbreitung ist unzulässig. Sollten Sie diese E-Mail irrtümlich erhalten haben, verständigen Sie bitte unverzüglich den Absender und löschen Sie diese Information aus Ihrem System.
 
CONFIDENTIALITY NOTICE:
This e-mail is confidential. Any unauthorized disclosure, copying, distribution or use in prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender and delete the intire communication from your system.

K

unread,
Jun 16, 2020, 10:34:06 PM6/16/20
to Google Apps Script Community
Thank you for helping! I have a question where can I put some onDate triggers in this code?

On Wednesday, June 17, 2020 at 4:18:41 AM UTC+7, iBO • App Service wrote:
e.g. 

App.prototype.isTriggerOn = //+
  function ( functionName ) {
    var result = false;
    var self = this;
    this.call( function () {
      return ScriptApp.getProjectTriggers().some( function ( trigger ) {
        if ( trigger.getHandlerFunction() == functionName ) {
          result = true;
          return true;
        }
      } );
    } );
    return result;
  }

call is exponential Backoff function

Am Di., 16. Juni 2020 um 12:51 Uhr schrieb Andrew Roberts <and...@roberts.net>:
You can check if the triggers already exist. Use the source function to identify the right one.

On Tue, 16 Jun 2020 at 11:08, K <hso.hum...@gmail.com> wrote:
So I have a time-driven triggers created but every time I launch the Web App it creates another triggers. How to prevent it to always create triggers?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages