Triggering onEdit() function in .gs when updating sheet through the app

This is all great advice, but I would actually use Google Scripts to do the timestamp until Glide provides us with a more consistent timestamping. Right now new App: Logins are timestamped in GMT, but timestamps sent from Glide Forms are based on the user’s own computer’s clock. This means that users all over the world will be timestamping in their local time and the app won’t have a consistent reference. I recently switched from all timestamps coming from Glide to all timestamps happening onChange with scripts. And finally I have consistent records of events across all users.

Also, I will add that if you want to make heavy use of Google Scripting with Glide, you should really look at retrieving sheet info in arrays, manipulating the array info, then writing all of that info back to the sheet in one setValues call.

One of the biggest culprits to a slow Google Script is too many calls to the spreadsheet. Every time you getValue or setValue, you’re making a new call to the sheet and that slows it down. Instead, you can pull all the data you need by getting the Range as an array of values (rather than calling for one value at a time), then make all necessary changes to the values of that array inside the script, and then in one single call back to the sheet you’ll use setValues (plural) to put all of them back in at once. In your case, that could reduce the amount of calls from around 30 to about 3.

Good luck! And welcome to Glide!

2 Likes