Transforms the data of a given Spreadsheet Sheet to JSON.
- The frozen rows are taken as keys for the JSON.
- The data taken for the values is only that after the frozen rows
exportJSON(Spreadsheet)
- transforms the data in the given sheet to JSON.
function onEdit(e) { | |
// Auto increment number column name | |
var aiColumnName = 'A'; | |
// The column that is tested, seq numbers will be | |
// given if this column is not empty. | |
var requieredColName = 'B' | |
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
var worksheet = spreadsheet.getActiveSheet(); | |
var aiColRange = worksheet.getRange(aiColumnName + '1:' + aiColumnName + '1000'); |
onEdit(e)
which is used for the Edit event on Spreadsheet has the old value as e.oldValue
. The specifications for this are as follows.
e
of onEdit(e)
shows hoge
for e.oldValue
and fuga
for e.value
.e.oldValue
and e.value
of onEdit(e)
are not shown anything.e.oldValue
and e.value
of onEdit(e)
are not shown anything.This sample script was created to retrieve both the edited values and the old values for the range of edited cells. This is the modified e.oldValue
.
function main() { | |
var destNumber = "12025550108"; // TODO: Specify the recipient's number here. NOT THE GATEWAY NUMBER! | |
var message = "Aloha, this is my first message."; | |
sendWhatsapp(destNumber, message); | |
} | |
function sendWhatsapp(destNumber, message) { | |
var instanceId = "YOUR_INSTANCE_ID_HERE"; // TODO: Replace it with your gateway instance ID here | |
var clientId = "YOUR_CLIENT_ID_HERE"; // TODO: Replace it with your Forever Green client ID here |
/* | |
* Copyright 2017 Mohsen Mesgarpour | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
function listFilesInFolder() { | |
var folder = DocsList.getFolder("Maudesley Debates"); | |
var contents = folder.getFiles(); | |
var file; | |
var data; | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
sheet.clear(); | |