Skip to content

Instantly share code, notes, and snippets.

@daichan4649
daichan4649 / convertSheet2Json.gs
Last active November 16, 2024 12:45
[GAS] load SpreadSheet as JSON #spreadsheet #calendar #google
function convertSheet2Json(sheet) {
// first line(title)
var firstRange = sheet.getRange(1, 1, 1, sheet.getLastColumn());
var firstRowValues = firstRange.getValues();
var titleColumns = firstRowValues[0];
// after the second line(data)
var lastRow = sheet.getLastRow();
var rowValues = [];
for(var rowIndex=2; rowIndex<=lastRow; rowIndex++) {
var urls = [
'http://www.example.com/',
'http://www.yahoo.com/',
];
var to = '[email protected]';
var sub = 'HTTP check failure';
var body = "The server seems to be down. Please check the server status.\n" ;
function myFunction()