Hello all,
I have a bit of a technical question about Appsheets way of editing the Google Spreadsheet that it uses for itโs Database.
Iโm writing some Google Script on the Spreadsheet Iโm using as Database for the App Iโm making in Appsheet. Itโs meant to send an email when a New Row is Added.
The Script works great, but when Adding a New Row by filling in a Form through the Appshet App it doesnโt fire the script onEdit or onChange as it would if that New Row was added via a Google Form.
Am I wrong on this, or is this true in your experience as well?
My workaround, in case anyone is looking for solutions here, is that I made a Mark column (โsentโ or empty). Then I run the script as TimeDriven every half hour and check for the last 10 rows with data from the bottom to the top of the spreadsheet, then check for the mark and if itโs not sent then fire the โSendEmailโ function and mark the column โSentโ so that on the next search, it wont send the email again.
And it works
However, the thing is that if adding rows to the spreadsheet through filling or editing Forms in Appsheet is NOT recognized as an Edit or Change in the Spreadsheets Google Script, than you have to make these TimeDriven Functions and thatโs really bad for two main reasons:
Any idea on this subject?
It would be a huuuge gain to know that you could run OnEdit functions through Google Script when filling in or editing Appsheet Formsโฆeither directly or through some workarounds if you know any.
Thank you,
Sorin
Hi @sorin_mihai! Have you had a chance to review any of our documentation on OnEdit? It might be able to answer your questions. If not, ping this thread again and weโll help you get to the bottom of this.
Hy,
Thanks for writing
Unfortunately, this is what it says from the first lines in the documentation:
" In particular, if you utilize Google AppScript onEdit triggers on your Google Sheet, or a third-party add on that utilizes these triggers, the triggers are not fired when AppSheet makes a change to the data in the spreadsheet. This is an unfortunate limitation imposed by Google ".
So that about answers it
Itโs really too bad they imposed this on you โฆ
Iโm thinking of making a column in the sheet that has a formula that edits itself when a line is introduced via Appsheet and maybe that edit will trigger the on edit.
You have any other ideas?
@sorin_mihai
Provided you are adding a new row to your gSheet via Google Form and provided that gSheet is assigned as a response sheet, than neither onChange nor onEdit works, you need to invoke the script via onSubmit(e).
Hi, Facing the same problem.
Did you find a solution to this?
I'm also facing the same issue. I'm trying to pre-add entries to another sheet based on what the user submits in the app, but the submission in the app does not trigger any onEdit/onSubmit/onChange event. Help please.
I have exactly the same problem. How to solve it?
onEdit() can only be used when the spreadsheet is open and being used by somebody to make changes in the sheet.
It is onChange() that you need to use and you must be very specific about the changes that should then trigger your script to send an email.
I used to do all of this using onChange() before Appscript Tasks were made available. I urge you to swap to Appscript Taks in Appsheet. You will never look at spreadsheet triggers again...well perhaps the onFormSubmit one, but that's a very specific use case...
User | Count |
---|---|
16 | |
13 | |
8 | |
7 | |
4 |