4
votes
Accepted
Update Google Sheet with Python
The update_cells call can update multiple cells at once. So you should calculate all new values locally and push the changes in one update. This should use only one ...
4
votes
Setting values in a spreadsheet
You can put all the value content to be set into an array, and set all the values at once.
...
3
votes
Accepted
Extract a number from a consecutive range in a Google Sheet
I guess the answer could be useful to someone that begin like me in coding...Anyway the tip here was to create an array first (I named it table) instead of adding ...
3
votes
Accepted
Hide rows where column F is not empty
In order to improve the performance of your script you should read cell values from an array that represents the entire range that your are going to scan.
This means that instead of repetedly calling
...
3
votes
Accepted
Small Python script using Google and Slack APIs
Compability with Python 3 is a good idea, in particular the print
statement should be a function call instead.
path.join can ...
3
votes
Accepted
Automatically Sending an Email based on a Google Sheet's cell value
Few minor things to improve:
you may unpack row in the for row in rows loop; moreover, you can use extended Python-3.x iterable ...
2
votes
Lock-range code for Google Scripts/Sheets
It's not necessary to include SpreadsheetApp.flush() as the last command of the if blocks because there aren't any command to be executed after those blocks and ...
2
votes
Tracking stock prices using Python and Google Sheets
This looks very interesting. Well done!
Here is some nitpicking:
...
2
votes
Nesting for loops to find matches in different tables
I don't know enough about the shape of testData to write great code, but you could preprocess and convert testData from an array ...
2
votes
Accepted
Updating Google Sheets table efficiently
These are my suggestions regarding performances:
Generate random numbers only if needed
The new value for the column 7 can be generated after you are sure that needs to be updated. From:
...
2
votes
Returns Google Sheet cells from a named range
I didn't run unit tests for this on different search inputs, but it should give an idea of how you can bundle index information into the results for consumption with array class methods. Because you ...
2
votes
Accepted
Grouping arrays with different lengths to make a single sentValues() for the spreadsheet
Use const and let as needed instead of declaring all variables as var. This helps the ...
2
votes
Accepted
Replace/remove all diacritics and converting different letters to Latin alphabet in multiple spreadsheet columns (multidimensional array)
Use a simple recursive function using Array.map. This maintains the initial structure of the multidimensional array without needing loops and all those array/string manipulations of ...
2
votes
Accepted
Slow performance of Google Apps Script that updates data
As the documentation says,
Using JavaScript operations within your script is considerably faster than calling other services. Anything you can accomplish within Google Apps Script itself will be much ...
1
vote
Slow performance of Google Apps Script that updates data
As this answer explains calling SpreadsheetApp.getActiveSpreadsheet() in every single iteration can slow things down dramatically. Moving that outside the loops can ...
1
vote
Accepted
Check Google Sheet for emails, verify delivery by api and Subscribe via api Benchmark
Exceptions
Using except Exception to ignore exceptions without knowing the exact causes is often not a great idea. It makes it hard for someone unfamiliar with the ...
1
vote
Google apps script Exceeded maximum execution time issue or 29k rows
According to a benchmark report by Tanaike
Methods of Sheets API can reduce the process costs from those of Spreadsheet Service by about 19 %.
But in the case of this script the impact of replacing ...
1
vote
Accepted
Google Apps Script shifting columns containing specified substring - using array functions
Just as a general note, you could avoid the temporary array by copying the array from the end. I would also use a temporary variable for simplicity:
...
1
vote
Modal displayed in Google Spreadsheet from Gscript
Redundant Code at the end of regenProductCache()
The following code appears at the end of that function:
...
1
vote
Copying contents of cells in a vehicle-tracking Google Sheet
Put all of your range notations into an object literal with inner arrays. See the object literal named objectRangeSettings Only check for ...
1
vote
Accepted
Structure the MaxCPC automation code
It's hard for me to analyze this code because:
I don't know what CPC even means (I'm not in the Ads business).
The code using referencing modules from API I'm not familiar with.
I don't really ...
1
vote
Accepted
Email finding bot
Congratulations on putting your code up for review for the first time here. It takes some courage and humility to ask invite criticism of one's code.
Indentation
Standard Ruby intentation is two ...
1
vote
Accepted
Spreadsheet generated through Google Drive file iteration
Tracking Previously Indexed Files
From my tests it appears that DriveApp.getFiles() returns the files in the order that they were last modified. This is not ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
google-sheets × 48google-apps-script × 35
javascript × 24
performance × 13
python × 8
beginner × 6
python-3.x × 4
array × 3
api × 3
email × 3
html × 2
excel × 2
datetime × 2
web-scraping × 2
finance × 2
google-drive × 2
object-oriented × 1
jquery × 1
ruby × 1
parsing × 1
python-2.x × 1
time-limit-exceeded × 1
formatting × 1
pandas × 1
inheritance × 1