Hi,
I have a script using the onedit trigger within google sheets, which does not trigger when Appsheets edits a cell.
I have read a few topics that suggest to use onChange rather than onEdit, however my script uses events to determine what cell it needs to update, i.e. if A1 is edited update B1, or if B1 is edited update C1.
If I modify the script to onChange, I do not get an event to determine the cell that was updated.
Has anyone got any workarounds please
@ddlaw
Long ago I have written an article about how to use onChange(e) installable trigger with AppSheet. You can read the article from here > www.able3ventures.com
Hi I have followed your advice for the onChange(e) event hanlder, but I can not get it to fire, do I need to install it?
So this is my code, which works as an onEdit(e) providing I edit a cell within the spreadsheet itself,
However if I rename it onChange it does not fire, even if I treat it as installable, where am I going wrong?
function onChange(e) {
var editRange = {top:2,bottom:2000,left:10,right:10};
var thisRow=e.range.rowStart;
if (thisRow<editRange.top || thisRow>editRange.bottom)return;
var thisCol=e.range.columnStart;
if (thisCol<editRange.left || thisCol>editRange.right)return;
var ss = SpreadsheetApp.getActiveSpreadsheet();
var West = ss.getSheetByName(โWest Ordersโ);
var WestNotes = ss.getSheetByName(โWest Notesโ);
var CopyWestNotes = West.getRange(2, 9,West.getLastRow(),2).getValues();
var ClearNotes = WestNotes.getRange(2,1,WestNotes.getLastRow(),2).clear();
var PasteWestId = WestNotes.getRange(2,1,West.getLastRow(),2).setValues(CopyWestNotes);
var formula = โ=IFerror(VLOOKUP(i2,โWest Notesโ!A:B,2,false)," ")โ;
var WestFormula = West.getRange(2,10,West.getLastRow(),1).setValue(formula);
}
@ddlaw
Your script code is not correct. Please refer to www.able3ventures.com
and from the Hamburger Menu on top left corner, choose BLOG. The blog post on top will help you out.
User | Count |
---|---|
42 | |
27 | |
25 | |
20 | |
13 |