google-apps-script

ReferenceError: “Drive” is not defined

与世无争的帅哥 提交于 2021-01-07 02:44:32
问题 In Google App Maker, I am writing a function in ServerScript that will convert a user-uploaded Excel spreadsheet to Google spreadsheet. I am using this piece of code (https://stackoverflow.com/a/35597644/9878092), but I am getting ReferenceError: "Drive" is not defined. I tried using the line of code that I got directly from the link: file = Drive.Files.insert(file, xlsxBlob, { and my own edited version: file = Drive.Files.update(file, ssFileID, xlsxBlob, { Where ssFileID is the file id of

ReferenceError: “Drive” is not defined

旧巷老猫 提交于 2021-01-07 02:43:46
问题 In Google App Maker, I am writing a function in ServerScript that will convert a user-uploaded Excel spreadsheet to Google spreadsheet. I am using this piece of code (https://stackoverflow.com/a/35597644/9878092), but I am getting ReferenceError: "Drive" is not defined. I tried using the line of code that I got directly from the link: file = Drive.Files.insert(file, xlsxBlob, { and my own edited version: file = Drive.Files.update(file, ssFileID, xlsxBlob, { Where ssFileID is the file id of

Updating Vlookup Formulas on Set time intervals using Script Editor

▼魔方 西西 提交于 2021-01-07 01:29:16
问题 I want to understand how to use Script Editor to refresh Vlookup formulas on Google sheet at set time intervals. Example of formula below: ={"Jira Ticket ID";ARRAYFORMULA(VLOOKUP(D2:D,'Jira Ticket Details'!A:G,7,0))} 来源: https://stackoverflow.com/questions/65352958/updating-vlookup-formulas-on-set-time-intervals-using-script-editor

Exception Error with Google Script when I tried to use moveActiveSheet

前提是你 提交于 2021-01-07 01:04:44
问题 I keep getting "Exception: Service Spreadsheets failed while accessing document with id " while trying to run moveActiveSheet to move a sheet in tab with index 4 to index 1. This just happened very lately. I had been using my code for months before this happened. Does any body is facing the same thing? My code is below var ss = SpreadsheetApp.getActiveSpreadsheet(); //========================================== //Arrange the Sheet // Store all the worksheets in this array var sheetNameArray =

Dynamically Autopopulate Column with getNotes

纵饮孤独 提交于 2021-01-06 07:57:18
问题 This is a followup question from the previous post. Basically I want to autopopulate the entire column with getNotes on the first row similar to that of ArrayFormula. The previous poster have kindly provided this function: function getNotes(rng){ const ss = SpreadsheetApp.getActive().getActiveSheet(); const index = ss.getMaxRows()-ss.getRange(rng).getNotes().flat().reverse().findIndex(v=>v!=''); const range = ss.getRange(rng+index); return range.getNotes(); } Which then uses getNotes("B1:B")

Dynamically Autopopulate Column with getNotes

情到浓时终转凉″ 提交于 2021-01-06 07:56:49
问题 This is a followup question from the previous post. Basically I want to autopopulate the entire column with getNotes on the first row similar to that of ArrayFormula. The previous poster have kindly provided this function: function getNotes(rng){ const ss = SpreadsheetApp.getActive().getActiveSheet(); const index = ss.getMaxRows()-ss.getRange(rng).getNotes().flat().reverse().findIndex(v=>v!=''); const range = ss.getRange(rng+index); return range.getNotes(); } Which then uses getNotes("B1:B")

Dynamically Autopopulate Column with getNotes

风格不统一 提交于 2021-01-06 07:56:28
问题 This is a followup question from the previous post. Basically I want to autopopulate the entire column with getNotes on the first row similar to that of ArrayFormula. The previous poster have kindly provided this function: function getNotes(rng){ const ss = SpreadsheetApp.getActive().getActiveSheet(); const index = ss.getMaxRows()-ss.getRange(rng).getNotes().flat().reverse().findIndex(v=>v!=''); const range = ss.getRange(rng+index); return range.getNotes(); } Which then uses getNotes("B1:B")

push nesting array unexpectedly and info

时光怂恿深爱的人放手 提交于 2021-01-05 12:47:34
问题 Summary: In google apps script (v8 for sheets), I'm trying to slice an array element out of one array and push it into a different array. Array will be [ [] [] [] ] but I'm getting like [ [] [[]] [[]] ] . This (I think) is creating later issues with using that to getRange/setValues where the length changes from getrange to setvalues. I would separate the issues, but I don't know if they're related. This seems like a lot to me, but when posting a short answer, I was asked for reproducible code

Suddenly moveActiveSheet returns an error - Google Apps Script

我只是一个虾纸丫 提交于 2021-01-05 07:55:26
问题 I am getting the following error: Exception: Service Spreadsheets failed while accessing document with id . . . when I try to execute a script on a Google sheet. The script worked fine until today. I believe the problem occurs between these two lines: var newTab = sheet.duplicateActiveSheet(); sheet.moveActiveSheet(1); because at the time of the error the duplicate sheet has been created but has not yet been moved to the first position. Is it possible that the "moveActiveSheet" command

Suddenly moveActiveSheet returns an error - Google Apps Script

こ雲淡風輕ζ 提交于 2021-01-05 07:55:06
问题 I am getting the following error: Exception: Service Spreadsheets failed while accessing document with id . . . when I try to execute a script on a Google sheet. The script worked fine until today. I believe the problem occurs between these two lines: var newTab = sheet.duplicateActiveSheet(); sheet.moveActiveSheet(1); because at the time of the error the duplicate sheet has been created but has not yet been moved to the first position. Is it possible that the "moveActiveSheet" command