I am trying to set up a script that returns a date when an adjacent cell is updated in our google sheet. I have tried using an OnEdit function, However, have discovered this wont work as the updates to the cell may also come through our app which is linked to the sheet. Essentially, our crews onsite will upload a photo through the app which updates the photo link in a column on our google sheet. We would like the column next to this to show the date "photo link" cell was last updated (or "changed"). This way we can keep track of when the photos are updated for our reporting. From what I have been reading this needs to be set up with an OnChange Trigger. However, I am not sure how to set this up? Any assistance would be great!
Asked
Active
Viewed 51 times
0
-
Under installable script restrictions it says: `Script executions and API requests do not cause triggers to run. For example, calling FormResponse.submit() to submit a new form response does not cause the form's submit trigger to run.`[installable trigger restrictions](https://developers.google.com/apps-script/guides/triggers/installable) – Cooper Oct 19 '20 at 04:22
-
Have a look [here](https://stackoverflow.com/questions/59362734/on-edit-doesnt-work-if-cell-auto-updates-need-a-workaround-google-sheets/59370962#59370962). – ziganotschka Oct 19 '20 at 09:57
1 Answers
0
Script executions and API requests do not cause triggers to run, so onChange
or onEdit
Triggers would only work if the spreadsheet is edited manually.
In this case you have 2 options:
1. Change your app's source code so that it also saves the date each time a user edits a photo link.
2. Create a trigger that runs every specific time (15-30 min) that checks if any photo links have been updated, if any changes are detected, edit the date to current time and then copy the data for the next comparison.

Alfredo
- 762
- 4
- 16