Google Apps Scripts is a powerful tool. All you need is a basic understanding of JavaScript and you can create any add on your heart desires.
Hoping to make Google Apps Script more accessible, I started a new project. This create a simple applicatoin that notifies you when a user has submitted a particular word to a Google Form. I plan on adding more features and will be posting tutorials as I add on to the project.
The code for this project is posted below.
// Kurt Kaiser, 2017
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var lastRow = sheet.getLastRow();
var lastColumn = sheet.getLastColumn();
// Go through recent submission, check for alert word
function checkSubmission() {
for (var i = 1; i < lastColumn; i++){
Logger.log(sheet.getRange(lastRow, i).getValue());
if("Friday" == sheet.getRange(lastRow, i).getValue()){
return true;
}
}
}
function sendAlertEmail(){
MailApp.sendEmail({
to: "kurtbkaiser@gmail.com",
subject: "Alert – Friday Requested",
body: "Someone has requested Friday."
})
}
// —————————————-
function main(){
if (checkSubmission()){
sendAlertEmail();
}
}
[/code]
No Comments Yet