Using a google script to calculate information in a spreadsheet

I am using a script in google sheets to calculate the distance between start and stop points. I can call this function by using a formula in my spreadsheet .

=GMfunc(a2,a3,“miles”)

Works great when I put the formula to call the function in my cells manually.

Doing it this way, the script runs on every cell, every time I open up the file - which eats through my 1000 API call limit in about 2.3 seconds.

3X_3_4_340994ff5b562d6bcad436482567252d9500ed02.png

Any ideas on how to have the script be called automatically through APPSHEET when the record is created, and then put only values in the distance column rather than the function formula - to stop eating my API calls on document open?

Point me in the right direction, please - I don’t expect you to do my work for me. I can’t afford to put you on my payroll.

0 1 153
1 REPLY 1

Search in this community with some keywords like this:

https://community.appsheet.com/search?q=%23ask%20script%20onchange

Using the onChange(e) trigger is the key to getting the scripts to run when data is updated by Appsheet.

Top Labels in this Space