google-apps-script

How do i resolve an error for auto assign number and email trigger?

家住魔仙堡 提交于 2021-02-11 13:41:24
问题 I have a script that triggers auto number and auto email to "on form submit". But i noticed that if the email address provided by the sender has a special character or the email path is incorrect, the auto number and auto email stops (even if there are valid email address involved). How to resolve the error? Error Message received: ReferenceError: Note is not defined at addAutoNumber(Code:62:2) function addAutoNumber() { var sheet = SpreadsheetApp.getActive().getSheetByName("Responses"); var

How to edit an imported Google sheet using ImportRange?

拥有回忆 提交于 2021-02-11 13:40:57
问题 I used =QUERY(IMPORTRANGE..) to import data from Sheet 1 to Sheet 2 for Column A, B & C. I have to take note in Column D of Sheet 2 for each entry imported. However, for any new one added, the note (for the previous ones) in Column D stays in the same cells. For example, the formula is in A2, so the new data will be added to A2,B2 & C2. The note is in D2. When a new one is imported, the previous one moved to A3, B3 & C3. However, the note is still in D2. Is there any way to make those notes

OnEdit function not working for shared users

谁说我不能喝 提交于 2021-02-11 13:35:16
问题 I have the following OnEdit script in a Google spreadsheet that inserts a timestamp when a checkbox is edited. The action is preformed when I make the edit, but does not work when the edit is made by another user. Any help is appreciated. function onEdit(e) { addTimestamp(e); } function addTimestamp(e){ //variables var startRow = 3; var targetColumn = 6; var ws = "MasterList"; //get modified row and column var row = e.range.getRow(); var col = e. range.getColumn(); if(col === targetColumn &&

How to protect ranges per specific users in google sheet?

感情迁移 提交于 2021-02-11 13:32:08
问题 I am trying to apply protection on all sheets and certain ranges using a google script, for every sheet in its workbook (and can be applied on new added sheets via a trigger later) the problem is, I want to assign different ranges to different users after protecting the whole sheet from anyone, but the people allowed to edit on their ranges! I can't seem to know why it doesn't work.. It works oppositely , allowing all users to edit all ranges but the protected ones. I want the first editor to

Google Script to import CSV file from Google Drive to G Sheets when specific cell is edited

隐身守侯 提交于 2021-02-11 13:09:45
问题 I have a script in my G Sheets that imports a CSV from Google Drive and I have attached it to a clickable button within the workbook. It works great. Here is the script: function myFunction() { var file = DriveApp.getFilesByName("FileName.csv").next(); var csvData = Utilities.parseCsv(file.getBlob().getDataAsString()); var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Imported File"); sheet.getRange('A1:K10000').clearContent(); sheet.getRange(1, 1, csvData.length, csvData[0]

Google Script to import CSV file from Google Drive to G Sheets when specific cell is edited

让人想犯罪 __ 提交于 2021-02-11 13:06:09
问题 I have a script in my G Sheets that imports a CSV from Google Drive and I have attached it to a clickable button within the workbook. It works great. Here is the script: function myFunction() { var file = DriveApp.getFilesByName("FileName.csv").next(); var csvData = Utilities.parseCsv(file.getBlob().getDataAsString()); var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Imported File"); sheet.getRange('A1:K10000').clearContent(); sheet.getRange(1, 1, csvData.length, csvData[0]

Google Script to import CSV file from Google Drive to G Sheets when specific cell is edited

不打扰是莪最后的温柔 提交于 2021-02-11 13:03:34
问题 I have a script in my G Sheets that imports a CSV from Google Drive and I have attached it to a clickable button within the workbook. It works great. Here is the script: function myFunction() { var file = DriveApp.getFilesByName("FileName.csv").next(); var csvData = Utilities.parseCsv(file.getBlob().getDataAsString()); var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Imported File"); sheet.getRange('A1:K10000').clearContent(); sheet.getRange(1, 1, csvData.length, csvData[0]

Google Apps Script uncaught error in Chrome Console

◇◆丶佛笑我妖孽 提交于 2021-02-11 12:44:50
问题 I have a simple data entry tool on my Sheet that's an HTML form and then it runs through the fields in the form and posts them to the sheet. The utility works absolutely fine on my home computer. I noticed when a colleague tried it, it failed. I checked his console and there was an uncaught error. I tried the utility on my work computer and it also failed to push the values to the sheet. Almost like there is some type of issue with the google.script.run function? I have had it work for others

calling sheet function in GAS

随声附和 提交于 2021-02-11 12:41:57
问题 Is there a way of calling sheet function in google-app-script? I want to call MATCH(), IMPORTRANGE(), and INDEX() functions to compute the return value in function definition like below. function abc(foo, bar) { a = MATCH(foo, IMPORTRANGE("address of sheet", "A:A"),0) b = MATCH(bar, IMPORTRANGE("address of sheet", "B:B"),0) return INDEX(IMPORTRANGE("address of sheet", "C:Z"),a,b) } Applying the sample provided by @Tanaike function doGet(e) { const [sheet1, sheet2, sheet3] = [e.parameter.url1,

Google Sheets: Hide rows in multiple sheets

狂风中的少年 提交于 2021-02-11 12:41:46
问题 I'm trying to hide rows across a multiple sheets. So I have a 6 sheets, but there are 4 similar sheets, the other one is more likely a summary of that 4 sheets and the other one is the sheet with a button. Here's a sample for your reference: LINK It is working if I will put a HIDE ROWS button on sheets one by one, but it will take a lot of time for me to do it since I need to put it on different spreadsheets. My idea is to put a button per spreadsheet or upon opening it, the rows that are