1

I use form submit trigger for my form which does some processing on my spreadsheets. The form submit process may take a while to complete(approximately 30secs). As responses are submitted in the form the trigger's processing time may exceed the quota of triggers run time which is 6 hours for Google Apps Work/Edu/Gov. Also the number of triggers per script limit is 20.

Are there any workarounds for these problem.

Amar
  • 11
  • 1
  • 2

2 Answers2

1

It may depend on what type of quota it is. Provided in this document - Best Practices, a list that will help you improve the performance of your scripts.

  • Minimize calls to other services
  • Use batch operations
  • Avoid libraries in UI-heavy scripts
  • Use the Cache service

Also, a blog about Google Apps Script talks about nearly all workarounds for the quotas will increase the code complexity like adding delays, increasing the intervals of each functions and splitting of script into smaller parts.

Hope this helps.

Mr.Rebot
  • 6,703
  • 2
  • 16
  • 91
0

There are a few methods I can think of:

1) Use another service to do batch processing. This could be something like App Engine, Google functions, or some other service.

2) Create batch processing user accounts in your domain. Each one will have their own 6 hour quota limit. Your form submit trigger would build a request and send it to one of the batch processing accounts. Note these accounts would need access to any resources required by the script.

3) Open a Google Apps Script issue requesting more processing time. I have no specific information, but I've heard some very heavy users can purchase "pro" support for apps script that includes longer run times.

4) Shave time off your script. Figure out why it needs a full 30 seconds to process and see if you can reduce that work load.

Spencer Easton
  • 5,642
  • 1
  • 16
  • 25
  • Cannot share files so 2 is not an option. Do you mean google cloud functions? can you direct me to any document on how i can use google functions or app engine from apps script. – Amar Nov 09 '16 at 16:23
  • There is no written docs for linking cloud functions, app engine, and apps script. But there a few methods: UrlFetchApp, Pub/Sub are two ways I can think of off the top of my head. – Spencer Easton Nov 10 '16 at 16:47