tanaike

The Thinker

Benchmark: High-Efficiency Finding and Replacing Many Values in Google Spreadsheet with Low Process Cost using Google Apps Script

Gists This is a sample script for high-efficiency finding and replacing many values in Google Spreadsheet with the low process cost using Google Apps Script. When the various values are replaced in Google Spreadsheet using Google Apps Script, I’m worried about the process cost. So, in this report, I would like to introduce a sample script for high-efficiency achieving this. As the result, using a sample situation, when the process cost of the sample script using Sheets API is compared with that of the sample script using Spreadsheet services (SpreadsheetApp), it was found that the above script using Sheets API could reduce the process cost by about 70 % from the script using Spreadsheet service.

Updating Destination Sheet by Source Sheet in Google Spreadsheet using Google Apps Script

Gists This is a sample script for updating the destination sheet by the source sheet in Google Spreadsheet using Google Apps Script. The sample situation is as follows. Sample script function myFunction() { const sheetNames = ["Sheet1", "Sheet2"]; // Retrieve values from source and destination sheets. const ss = SpreadsheetApp.getActiveSpreadsheet(); const [srcSheet, dstSheet] = sheetNames.map((s) => ss.getSheetByName(s)); const [srcValues, dstValues] = [srcSheet, dstSheet].map((s) => s.

Moving Cell Detection on Google Spreadsheet using Google Apps Script

Gists This is a sample script for detecting whether the specific cells on Google Spreadsheet are manually moved using Google Apps Script. In this case, the named range, OnChange trigger, and PropertiesService are used. Usage: 1. Create a named range. As a sample, please create a named range to the cells “A2:B2” as “sampleNamedRange1”. Ref 2. Prepare sample script. Please copy and paste the following script to the script editor of Spreadsheet.

Using RichTextValues with Custom Function on Google Spreadsheet

Gists In this post, I would like to introduce the method for using RichTextValue with a custom function of Google Apps Script. This sample is for this thread in Stackoverflow. In this thread, the OP’s goal is as follows. Put a text to a cell. In this case, use a hyperlink in a part of the text. This is required to be achieved using a custom function. In the current stage, in order to reflect the hyperlink in a part of the text, it is required to use setRichTextValue of Google Apps Script.

Retrieving Icons of each mimeType on Google Drive using Google Apps Script

Gists This is a sample script for retrieving icons of each mimeType on Google Drive using Google Apps Script. Sample script Sample list of mimeType is from this official document. function getIcons() { const iconSize = 256; // Pixels const mimeTypes = [ "application/vnd.google-apps.audio", "application/vnd.google-apps.document", "application/vnd.google-apps.drive-sdk", "application/vnd.google-apps.drawing", "application/vnd.google-apps.file", "application/vnd.google-apps.folder", "application/vnd.google-apps.form", "application/vnd.google-apps.fusiontable", "application/vnd.google-apps.jam", "application/vnd.google-apps.map", "application/vnd.google-apps.photo", "application/vnd.google-apps.presentation", "application/vnd.