February 2014
Beginner to intermediate
178 pages
4h 2m
English
While we are taking care of data privacy, let's have a quick peek at data protection using Google Apps Script.
Google has introduced this ability quite recently and it opens a few interesting perspectives.
The following is an example of a script that protects a sheet after a user has added a value in a particular cell:
function myFunction(e) { var sheetIndex = e.source.getSheets().length;// to know how many sheets we already have var sourceValues = e.source.getActiveSheet().getDataRange().getValues();//get all the data from this sheet var cell = e.source.getActiveRange().getA1Notation();//get A1 notation for comfort of use Logger.log('SheetName:'+e.source.getActiveSheet().getSheetName()+' user:'+Session.getActiveUser()); if(cell=='A1' ...Read now
Unlock full access