HTML form file-input fields are not converted to compatible blob format when submitted. They are left in application/octet-stream format. The file-input fields are passed as application/octet-stream, so DriveApp.createFile(formBlob) does not work correctly … So the functionality provided by HtmlService is not consistent with the documentation
There was an annoying little Google Apps Script issue which meant when handling file uploads to published Web Apps some additional coding was required rather than just sending the file blob server side. Thankfully the open issue ticket for this has recently been marked and confirmed fixed.
This is a sample script for executing a function with the minutes timer in the specific times using Google Apps Script. For example, when this sample script is used, the following situation can be achieved: Execute a function every 10 minutes only in 09:00 – 12:00 and 15:00 – 18:00 for the weekday.
A clever bit of coding from Kanshi Tanaike for running a Google Apps Script on a defined schedule. The part I found particularly interesting was the solution for programmatically setting triggers in the V8 runtime:
This sample script used Web Apps. Because when v8 runtime is used, when the trigger is set from the function executing by a trigger, the trigger is disabled. This is the recognized bug. But unfortunately, this has still not been resolved. (September 21, 2021) But, when the trigger is installed by Web Apps, no issue occurs. So, please deploy Web Apps.
For the sample code and explanation visit the source link.
The printStackTrace method of Java is useful for handling exceptions and errors during development. It tells you the exact line number in your source code and the file name where the problem occurred.
A better alternative is that you parse the stack property of the Error object. This contains the entire stack trace along with line numbers, column position and the function names.
Great debugging tip from Amit that you can use in Google Apps Script for parsing the entire stack trace along with line numbers, column position and the function names. Check the source link below for example code and usage.
If you have made it to this post you are probably a little frustrates about why your Google Apps Script time triggers are not running on or around the times that you have designated … To cut to the chase, the likely cause of clock triggers not running in the time range that you have selected is that the time zone in your Google Apps Script project is out.
Scott ‘Yagi’ Donald provides some very useful tips on how you can check and adjust your Apps Script project’s timezone.
Most of the comments I get on this site have to do with someone trying something I’ve written about that isn’t working for them. In most cases, error messages can be your friends since they can point to the particular place your script failed and give you additional insight into why it failed.
This post will describe some of the ways you can use the built-in tools of the Google Apps Script environment to debug or troubleshoot your own scripts. My goal here is start from the easiest to implement and work towards more difficult, but more efficient, methods of debugging.
This article will highlight how you have to be careful about settings when you make some content available publicly, like Groups or Drive file.
The original article describe how an external person of the domain can subscribe to your Slack company channel by using a Google Groups that is publicly accessible. Stéphane Giron’s article helps answer the question – how to prevent and how to identify if some groups are concerned.
This is an overview of the various techniques and best practices I have evolved in developing Google Apps Scripts over the years. Of course Google have got a few suggestions of their own, and there are plenty of more general …
This includes some good design pattern considerations for Apps Script projects as well as links to testing libraries, boilerplate frameworks, and extensions that help manage Apps Script work.
I’m a public school teacher writing Apps Script projects to manage documentation and to make life easier in general. You can read more on my blog, blog.ohheybrian.com or follow me on Twitter, @bennettscience.