google-sheets

Issues using setValues function

巧了我就是萌 提交于 2021-02-08 08:15:39
问题 I keep getting an error message when using the setValues() function to export an array to Google sheets. I have tried many different methods for creating my 2D array, but I still keep getting the same errors. Sometimes my code will run (the array will export to the spreadsheet) but I will still get an error. I originally used the setValue() function in a for loop but the code would time out because it ran too long. So I tried dumping all my data into a 2D Array and feeding that to the

Delete row if column has date older than one month

我与影子孤独终老i 提交于 2021-02-08 08:05:54
问题 I found this code from https://stackoverflow.com/users/6656050/jeremy-kahan and edited it a little. I need my sheet to delete any row when the entry in column L is older than one month, but keep the row if the cell in column L is empty i'll need some guidance. On request I can provide a copy of my sheet and show examples. It might seem easy it others but I feel at a disadvantage only being 16 and just learning java. function DeleteOldEntries() { var ss = SpreadsheetApp.getActiveSpreadsheet();

Google script oauth2 Error: redirect_uri_mismatch

ε祈祈猫儿з 提交于 2021-02-08 07:59:31
问题 I am not asking this question without searching and reading the docs. I spent 2 days so far. I am sure I am missing sth. I am trying to implement google auth on drive spreadsheet. I have tried everything but still getting the error message (redirect_uri_mismatch). Basically, I want a sidepanel with a login screen. User clicks the button, auth magic runs and redirects to another html printing "Success" when the user allows access. I created a project in google dev console. created credentials

Google script oauth2 Error: redirect_uri_mismatch

坚强是说给别人听的谎言 提交于 2021-02-08 07:58:28
问题 I am not asking this question without searching and reading the docs. I spent 2 days so far. I am sure I am missing sth. I am trying to implement google auth on drive spreadsheet. I have tried everything but still getting the error message (redirect_uri_mismatch). Basically, I want a sidepanel with a login screen. User clicks the button, auth magic runs and redirects to another html printing "Success" when the user allows access. I created a project in google dev console. created credentials

How to select a named range in Google Sheets' query?

北战南征 提交于 2021-02-08 06:49:56
问题 I'm trying to set up a query using named ranges, is it possible to select a named range within a query? I've tried the following: =QUERY(NamedRange, "select '"&NamedRange2&"' where '"&NamedRange3&"' contains '"&B2&"' ") I want to be able to use named ranges instead of having to use select A where... or select col1 where... since the spreadsheet is constantly going through revisions where columns change so I want to keep the query dynamic so it doesn't constantly need updating. 回答1: partially.

How to get active user email with installed onEdit trigger?

不羁的心 提交于 2021-02-08 06:48:59
问题 I have a Google spreadsheet with some data. I wrote script to track changes of some specific columns. function onOpen() { var ss = SpreadsheetApp.getActive(); var menuItems = [ {name: 'Turn on', functionName: 'createSpreadsheetEditTrigger'} ]; ss.addMenu('Tracker', menuItems); } function changeTrack(){ const ss = SpreadsheetApp.getActiveSpreadsheet(); const ui = SpreadsheetApp.getUi(); var ws = ss.getActiveSheet(); const headerRow = 4; const editBodyCols = [2, 3, 4, 5]; const fResultCol = 6;

How to get active user email with installed onEdit trigger?

心已入冬 提交于 2021-02-08 06:48:53
问题 I have a Google spreadsheet with some data. I wrote script to track changes of some specific columns. function onOpen() { var ss = SpreadsheetApp.getActive(); var menuItems = [ {name: 'Turn on', functionName: 'createSpreadsheetEditTrigger'} ]; ss.addMenu('Tracker', menuItems); } function changeTrack(){ const ss = SpreadsheetApp.getActiveSpreadsheet(); const ui = SpreadsheetApp.getUi(); var ws = ss.getActiveSheet(); const headerRow = 4; const editBodyCols = [2, 3, 4, 5]; const fResultCol = 6;

Google Sheets search value and return certain columns of multiple rows where the value is present

你说的曾经没有我的故事 提交于 2021-02-08 06:45:29
问题 I'm looking for a formula which can do the following: Lookup a value in column E:I and return all the values from column B:D from the rows it is present. Example: Looking for S190202 , it would return B:D from row 2,5,6 回答1: =QUERY(A1:I, "select B,C,D where E='S190202' or F='S190202' or G='S190202' or H='S190202' or I='S190202'", 1) for a cell reference, you can change it to: =QUERY(A1:I, "select B,C,D where E matches '"&K2&"' or F matches '"&K2&"' or G matches '"&K2&"' or H matches '"&K2&"'

Using IMPORTRANGE, INDIRECT, and CONCATENATE together

╄→гoц情女王★ 提交于 2021-02-08 06:35:35
问题 I have a sheet that pulls numbers from several different sheets to amalgamate numbers. Each week, a new sheet is added to the source files, all with the same name. I'd like to update the amalgamated sheet by changing one cell instead of many. When the tab is located in the same Google sheet, this is easily done with INDIRECT. Right now, the formula in the amalgamated sheet is: =IMPORTRANGE(M4, "Aug29!$F$2") That formula is on each line to pull from several different sheets: =IMPORTRANGE(M5,

Random substring error? “TypeError: Cannot find function substring in object…”

ⅰ亾dé卋堺 提交于 2021-02-08 06:24:17
问题 The error is: TypeError: Cannot find function substring in object The code loops through 10 values, checking for the first character being a number. function TypeErrorMystery() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = ss.getActiveSheet(); //loop from cell 1-10 for (var i = 0; i < 10; i++) { var range = s.getRange(i + 1, 1) var substring1 = range.getValue().substring(0, 1); //if first character in cell is # if (substring1 === "#" ) { //write over it with "success" range