Getting "Script invoked too many times per second" when running script in Google Spreadsheet

rustyDev

I have this scheduling application I implemented 4 years ago using Google Spreadsheets. It creates a schedule (or passport) for a science fair. Last year, to make it easier to understand, I created a simple script that looked up the room location to add to the activity:

function getRoom(project, map) {
  for (var i=0; i < map.length; i++) {
      if (map[i][0] == project)
          return(map[i][1]);
  }
  return("Not Found");
}

The Script is invoked close to 300 times on the worksheet as there are close to 40 schedules with 7 activities each. This worked fine till last year, started getting this error as I prepare the schedules for this year's science fair.

What quotas are this?

Zig Mandel

You haven't posted relevant code nor the actual error so I'll give a generic answer. 1) Read the apps script docs on how to write efficient gas code. 2) optimize often called functions. For example the map you showed could be rebuilt as a hash indexed by project. 2) if that still fails probably means you are running into a time quota since scripts can't run over 6minutes. If so you need to rewrite the code so it can process by parts and remember where it stopped so it can continue from there on next run. Run it manually until it completes all tasks or use a time trigger to run.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

google spreadsheet reading script in python not running from cron schedule but working when i am running it shell command

From Dev

Getting cell position when reading google spreadsheet

From Dev

Script for getting the tab/sheet name not working in google spreadsheet

From Dev

using google app script to make spreadsheet into a pdf but getting html

From Dev

Google Apps Script for Spreadsheet - Keep getting the function () { [native code] } error

From Dev

Different behaviors when getting spreadsheet from script properties and from string

From Dev

Getting time on Google spreadsheet

From Dev

Getting an error when running my script in a rule

From Dev

Getting an error when running awk from a script

From Dev

Getting a not subscriptable when running a web scraping script

From Dev

Why getting invalid literal when running this script?

From Dev

Getting 'missing or invalid option' when running this script

From Dev

Google App Script Spreadsheet

From Dev

Google Spreadsheet script (if and checkboxes)

From Dev

google script: issue with spreadsheet update when processed through trigger

From Dev

Google Script to force new spreadsheet entries to start at Row 2 after running script to clear the range

From Dev

When running bash script that calls another script getting EOF error

From Dev

Google Spreadsheet getting text with importxml

From Dev

trying to convert xls to google spreadsheet using google app script and getting "Empty response" error

From Dev

Google Sheets: Exclude a Tab when Running a Script

From Dev

google script to keep a running total when updated

From Dev

Getting NullPointerException while running script with Testng xml but script is working fine when running with "Running Testng Programatically"

From Dev

setValues, Google Spreadsheet Script error

From Dev

copy and paste with google spreadsheet script

From Dev

Google Spreadsheet Script - Search Function

From Dev

Getting blank screen after running Google web app script

From Dev

Running a script on one spreadsheet to change values on another spreadsheet

From Dev

Getting order Id error when running Ibapi / TWS API script

From Dev

Getting "numeric argument required" when running script with arithmetic operations

Related Related

  1. 1

    google spreadsheet reading script in python not running from cron schedule but working when i am running it shell command

  2. 2

    Getting cell position when reading google spreadsheet

  3. 3

    Script for getting the tab/sheet name not working in google spreadsheet

  4. 4

    using google app script to make spreadsheet into a pdf but getting html

  5. 5

    Google Apps Script for Spreadsheet - Keep getting the function () { [native code] } error

  6. 6

    Different behaviors when getting spreadsheet from script properties and from string

  7. 7

    Getting time on Google spreadsheet

  8. 8

    Getting an error when running my script in a rule

  9. 9

    Getting an error when running awk from a script

  10. 10

    Getting a not subscriptable when running a web scraping script

  11. 11

    Why getting invalid literal when running this script?

  12. 12

    Getting 'missing or invalid option' when running this script

  13. 13

    Google App Script Spreadsheet

  14. 14

    Google Spreadsheet script (if and checkboxes)

  15. 15

    google script: issue with spreadsheet update when processed through trigger

  16. 16

    Google Script to force new spreadsheet entries to start at Row 2 after running script to clear the range

  17. 17

    When running bash script that calls another script getting EOF error

  18. 18

    Google Spreadsheet getting text with importxml

  19. 19

    trying to convert xls to google spreadsheet using google app script and getting "Empty response" error

  20. 20

    Google Sheets: Exclude a Tab when Running a Script

  21. 21

    google script to keep a running total when updated

  22. 22

    Getting NullPointerException while running script with Testng xml but script is working fine when running with "Running Testng Programatically"

  23. 23

    setValues, Google Spreadsheet Script error

  24. 24

    copy and paste with google spreadsheet script

  25. 25

    Google Spreadsheet Script - Search Function

  26. 26

    Getting blank screen after running Google web app script

  27. 27

    Running a script on one spreadsheet to change values on another spreadsheet

  28. 28

    Getting order Id error when running Ibapi / TWS API script

  29. 29

    Getting "numeric argument required" when running script with arithmetic operations

HotTag

Archive