I have two combined blocks in cells that are filled with ranges in a sheet. When the first one changes, I create a URL and call:
var resp = UrlFetchApp.fetch(url, {"method": "get","muteHttpExceptions":false});
And it fills the second range, which controls the second combo box. This works fine in debug mode. But my goal is to work using the mode onEdit
. If the first combo box is changed, the method starts and populates the second. Using this statement:
mydoc.getActiveSheet().getRange(15, 1).setValue("Some debug message");
I put it in the whole method to see where it dies. I have an instruction right after a method UrlFetchApp.fetch()
that never writes, so I know where the problem is. Can you make these types of calls during events?
Again, it works great by launching it manually through the script editor, but not when called from onEdit
.
I see this question where they do not allow this, but the last comment in the thread said that it worked by adding another custom toEdit method. I call URLFetchApp
from another method, but I tried to create the myOnEdit function and called URLFetchApp
from there, but it still doesn't work. Not sure what he meant by manually contacting the event ...
source
share