Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to assign onEdit to specigfic tab

function onEdit(e) {
    var activeSheet = e.source.getActiveSheet();
    var range = e.range;
    if (activeSheet.getName() !== "Inventory" || e.value !== "notify") return;
    range.setBackgroundColor('red');
    var productname = range.offset(0, -3).getValue();
    var productinventory = range.offset(0, -2).getValue();
    var message = "Product variant " + productname + " has dropped to " + productinventory;
    var subject = "Low Stock Notification";
    var emailAddress = "email@email.com";
    MailApp.sendEmail(emailAddress, subject, message);
    range.offset(0, 1).setValue("notified");
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: js ctx dash line 
Javascript :: how to change created_at format with javascript rails 
Javascript :: how to click on alret dialog with pupeteer 
Javascript :: how to check is the key of a localstorage is emopty 
Javascript :: javascript format time from number 
Javascript :: TypeError: fxn.call is not a function 
Javascript :: for of loop ecmascript6 
Javascript :: react using button props child 
Javascript :: nextjs link image 
Javascript :: mariadb javascript 
Javascript :: JavaScript try...catch Statement 
Javascript :: how to use datepicker apply to send a get request 
Javascript :: selialize jquery 
Javascript :: create new record mongoose 
Javascript :: how to add background to kaboom js 
Javascript :: can i select multiple classes and give function to them at once but different in js 
Javascript :: middleware uses 
Javascript :: autocomplete data selected validation jquery 
Javascript :: hash_hmac javascript 
Javascript :: today tomorrow day after tomorrow button html and javascript 
Javascript :: random email js 
Javascript :: stack overflow js bubble sort 
Javascript :: html2canvas not getting image if file field src is url 
Javascript :: valueof js 
Javascript :: javascript typeof array 
Javascript :: set json column as index pandas dataframe 
Javascript :: Reactjs cant find serviceWorker.js file in app src folder 
Javascript :: javscript randomly generate 89digit number 
Javascript :: load js on only specific page wp 
Javascript :: mongoose sort 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =