tanaike

The Thinker

Parsing JSON Data Array by Expanding Header Row using Google Apps Script

Gists This is a sample script for parsing JSON data array by expanding the header row using Google Apps Script. Sample script function myFunction() { const obj = [ { key1: "value1", key2: "value2", key3: "value3" }, { key4: "value1", key5: "value2", key6: "value3" }, { key7: "value1", key8: "value2", key9: "value3" }, ]; const headers = Object.keys( obj.reduce((o, e) => (Object.keys(e).forEach((k) => (o[k] = true)), o), []) ); const values = [headers, .

Exporting Tabulator Data to Google Drive using Google Apps Script

Gists This is a sample script for exporting the Tabulator data to Google Drive using Google Apps Script. As the sample, a dialog on Google Spreadsheet is used. So, please copy and paste the following scripts to the container-bound script of Google Spreadsheet. Google Apps Script side: Code.gs const saveFile = (e) => DriveApp.createFile(Utilities.newBlob(...e)).getId(); // Please run this script. const openDialog = (_) => SpreadsheetApp.getUi().showModalDialog( HtmlService.createHtmlOutputFromFile("index"), "sample" ); HTML & Javascript side: index.

Requesting to Gate API v4 using Google Apps Script

Gists This is a sample script for requesting to Gate API v4 using Google Apps Script. The official document of Gate API v4 is here. Recently, I answered this thread. In that case, in order to convert the sample python script to Google Apps Script, the script for retrieving the signature might be a bit complicated. So, here, I would like to introduce this. Sample python script from official document This is a sample python script from official document.

Retrieving Text Positions in Text Data using Google Apps Script

Gists This is a sample script for retrieving the text positions in the text data using Google Apps Script. For example, in order to set the rich text style the part of text from the text data, this sample script will be useful. Sample situation 1 The sample situation is as follows. sample1, sample2, sample3, sample4, sample5 sample1, sample2, sample3, sample4, sample5 sample1, sample2, sample3, sample4, sample5 In this sample, the text positions of sample2 and sample5 are retrieved from this sample text data.