In have an installed trigger for onEdit and an installed trigger for onChange. I log the contents of the event object that is passed in as below
function installedOnChange(e) {
var me = CalleeName(arguments);
Logger.log("%s: %s", me, JSON.stringify(e));
(CalleeName is defined as
function CalleeName(a) {
return a.callee.toString().split(" ")[1].split("(")[0].trim();
}
).
The stringification of the event contains .oldvalue
and .value
except in the situation where a cell is ^C copied and then ^V pasted into another cell. In that case, neither are given. For example, here we have the onEdit and onChange event data for copying into J19:
onEdit: {"authMode":"FULL","range":{"columnEnd":10,"columnStart":10,"rowEnd":19,"rowStart":19},"source":{},"triggerUid":"3504192","user":{"email":"data@blahblahblah","nickname":"data"}}
onChange: {"authMode":"FULL","changeType":"EDIT","source":{},"triggerUid":"3538611","user":{"email":"data@blahblahblah","nickname":"data"}}
As you can see, no .value
and no .oldvalue
.
I can equivalence the .value
by evaluating e.source.getActiveCell().getValue()
however, I cannot -- thus far -- establish what the previous value of the cell was, that is, what the destination cell held before the ^V paste was issued.
It occurred to me that perhaps this value might be available in the Show Edit History, a list available by right-clicking a cell in the sheet. However, I cannot find a programmatic interface to that information. Does such a thing exist? If so, how? and if not, where do I post a change request?