google-apps-script

How to restrict google forms submission based on two ID using GAS on Google Form or Google Sheets

拥有回忆 提交于 2020-07-30 04:03:28
问题 I'm working on a query Google Form which collects participants' votes to a certain question. I want to restrict participants based on the ID number. I was thinking of three approaches: Prevent form submission if the entered ID is not on the given list. (I prefer this approach but couldn't find any useful code for it so far) Delete rows in the linked responses spreadsheet after form submission using GAS on Google Form through onFormSubmit trigger. Here is my code which is not working: function

Google Script App Fails in Incognito Mode

一世执手 提交于 2020-07-26 13:17:25
问题 I have a simple Google Script published as a web app with anonymous access. The code is available here and the web app is available here. code.gs function doGet() { return HtmlService.createHtmlOutputFromFile("index").setTitle("Google Script") } index.html <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <p>Hello</p> </body> </html> The script web app works in normal Chrome mode but returns a 500 error when the page is viewed in the incognito mode of Chrome or Firefox. The

Google Script App Fails in Incognito Mode

我的未来我决定 提交于 2020-07-26 13:16:32
问题 I have a simple Google Script published as a web app with anonymous access. The code is available here and the web app is available here. code.gs function doGet() { return HtmlService.createHtmlOutputFromFile("index").setTitle("Google Script") } index.html <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <p>Hello</p> </body> </html> The script web app works in normal Chrome mode but returns a 500 error when the page is viewed in the incognito mode of Chrome or Firefox. The

Google Script App Fails in Incognito Mode

妖精的绣舞 提交于 2020-07-26 13:15:32
问题 I have a simple Google Script published as a web app with anonymous access. The code is available here and the web app is available here. code.gs function doGet() { return HtmlService.createHtmlOutputFromFile("index").setTitle("Google Script") } index.html <!DOCTYPE html> <html> <head> <base target="_top"> </head> <body> <p>Hello</p> </body> </html> The script web app works in normal Chrome mode but returns a 500 error when the page is viewed in the incognito mode of Chrome or Firefox. The

Fill Dropdown from Selected Item

筅森魡賤 提交于 2020-07-23 10:17:27
问题 What I am trying to make is a workbook that users can select from a dropdown of a group of items (Sheet1, Column A) and then Row B lookup that selected item in sheet "Dataset" and return that value with integers that go from 0 to the corresponding stock quantity total in (Sheet "Dataset" column C) here is a Sample spreadsheet I got some awesome code from @iamblichus that will fill the dropdowns from the corresponding stock quantity see his code here that I have somewhat implemented Here using

Fill Dropdown from Selected Item

这一生的挚爱 提交于 2020-07-23 10:16:36
问题 What I am trying to make is a workbook that users can select from a dropdown of a group of items (Sheet1, Column A) and then Row B lookup that selected item in sheet "Dataset" and return that value with integers that go from 0 to the corresponding stock quantity total in (Sheet "Dataset" column C) here is a Sample spreadsheet I got some awesome code from @iamblichus that will fill the dropdowns from the corresponding stock quantity see his code here that I have somewhat implemented Here using

Fill Dropdown from Selected Item

喜夏-厌秋 提交于 2020-07-23 10:15:26
问题 What I am trying to make is a workbook that users can select from a dropdown of a group of items (Sheet1, Column A) and then Row B lookup that selected item in sheet "Dataset" and return that value with integers that go from 0 to the corresponding stock quantity total in (Sheet "Dataset" column C) here is a Sample spreadsheet I got some awesome code from @iamblichus that will fill the dropdowns from the corresponding stock quantity see his code here that I have somewhat implemented Here using

TypeError: Cannot call method “getActiveSheet” of null. at myFunction(Code:6)

旧时模样 提交于 2020-07-23 08:28:17
问题 In Log I can see app has been defined as SpreadsheetApp, but the getActiveSpreadsheet() is returning null. which in turn causes the getActiveSheet() to say it cannot call method with null. I've already tried clearing my browser history, opening a new blank spreadsheet but get same error. function myFunction() { var app = SpreadsheetApp; Logger.log(app); var ss = app.getActiveSpreadsheet(); Logger.log(ss); var activeSheet = ss.getActiveSheet(); TypeError: Cannot call method "getActiveSheet" of

TypeError: Cannot call method “getActiveSheet” of null. at myFunction(Code:6)

杀马特。学长 韩版系。学妹 提交于 2020-07-23 08:27:12
问题 In Log I can see app has been defined as SpreadsheetApp, but the getActiveSpreadsheet() is returning null. which in turn causes the getActiveSheet() to say it cannot call method with null. I've already tried clearing my browser history, opening a new blank spreadsheet but get same error. function myFunction() { var app = SpreadsheetApp; Logger.log(app); var ss = app.getActiveSpreadsheet(); Logger.log(ss); var activeSheet = ss.getActiveSheet(); TypeError: Cannot call method "getActiveSheet" of

TypeError: Cannot call method “getActiveSheet” of null. at myFunction(Code:6)

笑着哭i 提交于 2020-07-23 08:26:08
问题 In Log I can see app has been defined as SpreadsheetApp, but the getActiveSpreadsheet() is returning null. which in turn causes the getActiveSheet() to say it cannot call method with null. I've already tried clearing my browser history, opening a new blank spreadsheet but get same error. function myFunction() { var app = SpreadsheetApp; Logger.log(app); var ss = app.getActiveSpreadsheet(); Logger.log(ss); var activeSheet = ss.getActiveSheet(); TypeError: Cannot call method "getActiveSheet" of