Skip to main content
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 ...
Graipher's user avatar
  • 41.1k
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. ...
Alan Wells's user avatar
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 ...
Shinobe's user avatar
  • 51
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 ...
t3chb0t's user avatar
  • 44.3k
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 ...
ferada's user avatar
  • 11.1k
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 ...
alecxe's user avatar
  • 17.3k
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 ...
Rubén's user avatar
  • 163
2 votes

Tracking stock prices using Python and Google Sheets

This looks very interesting. Well done! Here is some nitpicking: ...
JaDogg's user avatar
  • 4,531
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 ...
Drew Reese's user avatar
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: ...
Marc's user avatar
  • 5,674
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 ...
tehhowch's user avatar
  • 151
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 ...
TheMaster's user avatar
  • 256
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 ...
TheMaster's user avatar
  • 256
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 ...
TheMaster's user avatar
  • 256
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 ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
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 ...
Sara J's user avatar
  • 3,737
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 ...
Rubén's user avatar
  • 163
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: ...
Marc Rohloff's user avatar
  • 3,477
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: ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
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 ...
Alan Wells's user avatar
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 ...
Rene Saarsoo's user avatar
  • 2,062
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 ...
Wayne Conrad's user avatar
  • 3,284
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 ...
Joshua Dawson's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible