Goal:
To create a Google spreadsheet function which fires when a user enters a particular, exact value (in this case, the person's legal name) into a cell (in this case it will always be in the first column). Upon firing, the row color of that cell which was edited should change the background color, text color, and font type. It should also automatically enter the current date into the same row, in the second column.
Questions:
Event objects - what are objects? Review this.
onEdit - can I call my setRowColors function inside of it? If so, how?
Knowns:
The sample that google gives for using onEdit in sheets is the following:
https://developers.google.com/apps-script/guides/triggers/#onedit
Processing/Assumptions:
1. Objects have properties and values. "e" is the name of an established object from Google which has different properties available depending if one is working in Sheets, Docs, Calender, etc...and the type of desired trigger/event. We are in Sheets so the available properties are we are wanting a function to run upon Sheets being edited. Therefore the properties we have available are
a. authMode
b. user
c. source
d. range
e. value
2. I found a list of functions built in to Google scripts which are associated to objects (in other words I found a list of methods per established objects). The above list that I first thought were properties are actually the established objects themselves which have their own set of associated functions or methods. Value is the same as range only when it refers to a single cell -therefore it most useful to look at range's set of methods: https://developers.google.com/apps-script/reference/spreadsheet/range
3. The header of the previous page actually refers to range as a class -not as a single object. A class is a "type" of objects. Range is a type or category of objects. Classes have certain methods and properties. The link above are still methods associated with this class. We create an object "e" which represents an "event object" in the class "range." Maybe this is wrong, but I am done for the day.
Mindy R. Bowen
No comments:
Post a Comment