I've created a Google Sheet for an RPG character sheet. I wrote a script to make it work. Now I wish to share it online, but am worried that anyone accessing the Sheet can also edit the script. I want the people I share the sheet with to be able to run the scripts, but not be able to change them. The last thing I want is for somebody to turn it into a virus or something. My online searches have provided zero instructions on protecting the scripts from editing, but still allowing usage. Is what I want even possible? If so, could they point me to any videos that show how? Thanks.
This is what I have: I built a google form that feeds into a google sheet reference tab.
That data is then referenced by multiple other tabs, depending on the values chosen in one of the columns. In this case the data is for vehicles. So the tabs are created based on the vehicle value chosen in the field on the google form. Responders can choose from 5 vehicles on their form, and each tab pulls the data from the response submission.
Example:
Responder inputs information for Vehicle 5, such as odometer reading, oil level, etc., and then a reference tab pulls the data from that submission using an =iferror(query('reference sheet' !A2:W1000, "where F contains 'VIN XXXX' ")," ")
That part I have down and it is working well.
The issue I am facing is that I have 4 functions that I need to execute whenever a vehicle tab changes after a form submission, but only if the values change due to a formula recalculation on a specific tab change. So using the same example above, when a form is submitted for Vehicle 5 with a value of "YES" for new damages, I want the function that sends out an email notifying me that new damage was marked yes for Vehicle 5 to execute, but I do not want it to execute if someone marked "YES" for new damages on Vehicle 4, or if a form is submitted that doesn't change anything on the sheet tab for Vehicle 5.
I have tried triggers in Google App Scripts functions to execute on form submit, but it was firing off any of the applicable functions on EACH form submit. For example, when someone submits a response via the form for Vehicle 1, and oerssd another for Vehicle 3, I was getting notifications for both vehicles each time the form was submitted.
How do I get it so the function to only executes once for the data in a tab that was changed, and won't execute again until that data is changed again? And have it do this for multiple tabs?