Gists
This is a sample script for protecting the cells of a Spreadsheet by clicking a checkbox using Google Apps Script.
You might have a situation where you want to protect the cells when a user checks a checkbox. This sample script is for achieving this situation. The demonstration of this sample script is as follows.
This demonstration is for a user. You can see that when the checkbox is checked, the checkbox and the right side of the checkbox are protected.
Gists
This is a sample flow for parsing XML data in Google Apps Script using IMPORTXML. Recently, it seems that ContentService.MimeType.XML has been removed by the Google side. By this, in the current stage, the XML data cannot be directly loaded by the Web Apps URL with IMPORTXML. From this current situation, I would like to introduce a workaround. In this workaround, the XML data in Google Apps Script is parsed by IMPORTXML of the built-in function of Google Spreadsheet.
There is a method of ScriptApp.getService().getUrl() for obtaining the Web Apps URL in Google Apps Script.
Before the V8 runtime is released, this method had returned the endpoint like https://script.google.com/macros/s/{deploymentId}/exec.
After the V8 runtime was released, the endpoint of https://script.google.com/macros/s/{deploymentId}/dev was returned.
Now, it seems that this returns https://script.google.com/macros/s/###/exec.
But, in the current stage, when I access this endpoint, the message of Sorry, unable to open the file at this time.
Gists
Introduction When we use HTML in the Google Apps Script project, in order to show the values from the Google Apps Script side, the HTML template is used. When I used the HTML template with a large value, I understood that the process cost can be reduced by devising a script. In this report, I would like to introduce the process cost of the HTML template using the benchmark.
Gists
This is a sample method for publishing various Google Docs files with the same URL using Google Apps Script.
By updating on May 25, 2022, the content got to be able to be embedded as a full page in the new Google site. Ref In this method, this is used.
Usage 1. Create a Google Docs. First, as a simple sample, please create a new Google Spreadsheet. And please copy the URL like https://docs.