Google Apps Script Service Error Spreadsheets
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about
Execution Failed: Service Error: Spreadsheets
Stack Overflow the company Business Learn more about hiring developers or posting ads with service error google script us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is
Service Error Spreadsheets Line
a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Service Error: Spreadsheets on Google Scripts up vote 5 down vote favorite 3 Scope copyvaluestorange I started to write an script that will make chained calls to an API (with a JSON response) and write the result into a Spreadsheet. What Happens: Once i debug the script code, it runs just fine, with no major problem, but once i run it from the Spreadsheet button itself (from the menu i created) it runs some steps of the script and than, pops a : Service Error: google sheet getrange Spreadsheet with no other error details. Weirdness I Started to "Log" the current step of the process to a Spreadsheet cell, so that i can monitor its progress while running the script out of the debugger. The problem is, once i move some "random" pieces such as : sheet.getRange("F2").setValue(currentPage); the code tends to break in different points. Code Sample : You can find a code to reproduce the issue here : http://pastebin.com/HjmSwEYZ All you have to do is : 1 - Create a new Spreadsheet on Google Drive 2 - Hit Tools -> Script Editor 3 - Create a new Script, paste the code in, and save 4 - Reload the Spreadsheet (F5) so that the custom menu will now appear "Guild Wars 2 Tracker" 5 - Click the button and hit "List All" Desired Output: What this code should (if it wasn't for this error) do is : 1 - Execute a request on this url : http://www.gw2spidy.com/api/v0.9/json/items/all/1 (which will return the first page of Guild Wars 2 itens) 2 - Iterates over each page, parsing the json and writing the returned values into the Spreadsheet Disclaimer: Sorry about all the "Log" messages in the sheet. This was a desperate attempt to track my progress, i know i
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen
von GoogleAnmeldenAusgeblendete FelderNach Gruppen oder Nachrichten suchen
Power User Advanced Reviews Some Simple Debugging for Google Apps Script Leave a reply Even though I've been programming for more years than I care to admit, I rarely write code correctly at the first attempt. Debugging, therefore, is an important part of of my development workflow. In this post I'll cover some basic techniques that can help you track down and stomp on errors in your Apps Scripts. When using the Script Editor, you'll occasionally see an error message appear in a red bar at the top of the screen. The line of code containing the error is usually highlighted too. Two common types of errors, namely syntax errors and runtime errors, tend to be displayed via this method. Click image to enlarge In this instance, the message is helpfully telling me that I have an Unterminated string literal on line 2. That's JavaScript-speak for a missing closing comma - and it's right, I have. That's a syntax error. Runtime errors can be harder to track down, because they don't contravene the grammar rules; they only show up when trying to run the code. Take a look at this code snippet: function displayDistance() { var output = "The current distance is: " + distance + "miles"; Browser.msgBox(output); } displayDistance(100); In this version of the code, I've corrected the missing comma, but forgotten to pass the parameter distance as an argument in my function definition. Nothing's wrong until I try to run the code: Click image to enlarge Now the message correctly points out that distance is not defined. You can generate these messages yourself, if you want to, using the throw() command in your code. Of course, using throw() can generate such a message at any time during code execution, not just under error conditions. Here's an example: function displayDistance(distance) { var output = "The current distance is: " + distance + "miles"; throw("The value of parameter distance was displayed as " + distance); Browser.msgBox(output); } Here's how it looks: Click image to enlarge I don't use this very often, as I find it intrusive, but you might find it to your taste. Unfortunately, some mistakes cause no error messages. This often happens when the co