tanaike

The Thinker

Analyzing Responses from Grid Items of Google Form using Google Apps Script

Gists This is a sample script for analyzing the responses from Grid Items of Google Form using Google Apps Script. In this sample situation, all responses are retrieved from Grid Items of Google Form, and the average values of each row of each question are calculated. And, the result is put on the Spreadsheet. Sample situation Input: Sample Google Form The sample Google Form is as follows. Output: Sample Spreadsheet The sample output is as follows.

Report: Handling 10,000,000 cells in Google Spreadsheet using Google Apps Script

Gists Introduction On March 14, 2022, it reported about “Google Sheets doubles cell limit”. Ref By this update, now, the users can use 10,000,000 cells in a Google Spreadsheet. This is great news for us. When I tried to handle 10,000,000 cells in a Google Spreadsheet using Google Apps Script, it was found that there were various important points. In this report, I would like to introduce the important points for handling 10,000,000 cells in Google Spreadsheet using Google Apps Script.

Replacing Multiple Paragraphs on Google Document with a Regex using Google Apps Script

Gists This is a sample script for replacing the multiple paragraphs on Google Document with a regex using Google Apps Script. There is the method of replaceText(searchPattern, replacement) for replacing the text on Google Document. Ref For example, when a text of sample1 is replaced with sample2, this can be achieved by a script like DocumentApp.getActiveDocument().getBody().replaceText("sample1", "sample2"). But, when the texts for replacing are the multiple paragraphs, this script cannot be used.

Simply Converting HTML to Plain Text using Google Apps Script

Gists This is a sample script for simply converting HTML to plain text using Google Apps Script. Sample values HTML (input value) <div id="sample1">sample text1</div> <div id="sample2">sample text2</div> <ul id="sample3"> <li>sample list 1</li> <li>sample list 2</li> </ul> <table id="sample4"> <tbody> <tr> <td>a1</td> <td>b1</td> <td>c1</td> </tr> <tr> <td>a2</td> <td>b2</td> <td>c2</td> </tr> </tbody> </table> Text (output value) sample text1 sample text2 - sample list 1 - sample list 2 a1 b1 c1 a2 b2 c2 Sample script function myFunction() { const sampleHTML = `<div id="sample1">sample text1</div> <div id="sample2">sample text2</div> <ul id="sample3"> <li>sample list 1</li> <li>sample list 2</li> </ul> <table id="sample4"> <tbody> <tr> <td>a1</td> <td>b1</td> <td>c1</td> </tr> <tr> <td>a2</td> <td>b2</td> <td>c2</td> </tr> </tbody> </table>`; const temp = GmailApp.

Merging Rows with Same Header Title in Google Spreadsheet using Google Apps Script

Gists This is a sample Google Apps Script for processing the values in Google Spreadsheet. In this sample situation, each row is merged using the same header title. In this sample script, the sample input and output situations are as follows. Sample situation Input: Output: Sample script In this sample script, this sample can be used as the custom function. function SAMPLE(values) { const headers = [ ...new Set( values .