google-apps-script

How do I apply a script to only one sheet within a google spreadsheet

一笑奈何 提交于 2021-01-27 07:14:47
问题 I have a google spreadsheet with two sheets called Robin and Lucy. I've made/found/mangled a script to sort the data on the sheet each time I add some data to column A function onEdit(event){ var sheet = event.source.getActiveSheet(); var editedCell = sheet.getActiveCell(); var columnToSortBy = 1; var tableRange = "a2:I30"; if(editedCell.getColumn() == columnToSortBy){ var range = sheet.getRange(tableRange); range.sort( { column : columnToSortBy } ); } } This script works great, but I only

How do I apply a script to only one sheet within a google spreadsheet

纵饮孤独 提交于 2021-01-27 07:14:16
问题 I have a google spreadsheet with two sheets called Robin and Lucy. I've made/found/mangled a script to sort the data on the sheet each time I add some data to column A function onEdit(event){ var sheet = event.source.getActiveSheet(); var editedCell = sheet.getActiveCell(); var columnToSortBy = 1; var tableRange = "a2:I30"; if(editedCell.getColumn() == columnToSortBy){ var range = sheet.getRange(tableRange); range.sort( { column : columnToSortBy } ); } } This script works great, but I only

Copy Google Spreadsheet + Share with same users in script

≡放荡痞女 提交于 2021-01-27 05:30:19
问题 I have searched the far reaches of the internet for a couple days now, but cannot seem to find a solution to my issue. I have limited knowledge of programming, but if I can get this to work, it is going to do wonderful things. EXPLANATION: I need to make a copy of a template spreadsheet, using a script inside spreadsheet A and copy over all the permissions of the template into the copy (specifically the name and protected ranges). I am using SheetSpider. As of right now, I can create the

Copy Google Spreadsheet + Share with same users in script

邮差的信 提交于 2021-01-27 05:28:34
问题 I have searched the far reaches of the internet for a couple days now, but cannot seem to find a solution to my issue. I have limited knowledge of programming, but if I can get this to work, it is going to do wonderful things. EXPLANATION: I need to make a copy of a template spreadsheet, using a script inside spreadsheet A and copy over all the permissions of the template into the copy (specifically the name and protected ranges). I am using SheetSpider. As of right now, I can create the

Gmail Add-On: Oauth not being triggered

大憨熊 提交于 2021-01-27 04:19:32
问题 In the code below, 'Test' button triggers a function which calls an external endpoint to load data. However, nothing happens when the button is clicked and I get a 400 error in the console area saying Invalid Argument . Code.gs function buildAddOn(e) { // Create a section for that contains all user Labels. var section = CardService.newCardSection() var action = CardService.newAction() .setFunctionName("testCall"); var button = CardService.newTextButton().setText('Test').setOnClickAction

Need to check for login username and password, and then bring data from previous entries

ぐ巨炮叔叔 提交于 2021-01-25 08:08:25
问题 Following this question I had asked previously (Need to Query Google Sheet for specific data from Google Apps Script). I have created a web app to track the working hours of employees at my company, the web app is simple, it first asks them to provide their username and a password, and then allows them to register their time of entry o their exit time. Now, I need to find a way to check for a match between username and password (in a data base), and if this is true, bring information about

Need to check for login username and password, and then bring data from previous entries

穿精又带淫゛_ 提交于 2021-01-25 08:07:20
问题 Following this question I had asked previously (Need to Query Google Sheet for specific data from Google Apps Script). I have created a web app to track the working hours of employees at my company, the web app is simple, it first asks them to provide their username and a password, and then allows them to register their time of entry o their exit time. Now, I need to find a way to check for a match between username and password (in a data base), and if this is true, bring information about

Can I pass an array into a Google App Script method from a Google Spreadsheet?

一曲冷凌霜 提交于 2021-01-24 14:17:19
问题 Can I pass an array into a Google App Script method from a Google Spreadsheet? Suppose I have an App Script function that expects a list with two elements (note: this example is just an example so please do not tell me that my problem would be solved if I simply passed each element as a separate argument). How do I call this function from a Google Spreadsheet cell? I've tried both: '=myFunc([1,2])' and '=myFunc((1,2))' and both give me a Parse Error. 回答1: In a spreadsheet formula, you can

Can I pass an array into a Google App Script method from a Google Spreadsheet?

流过昼夜 提交于 2021-01-24 14:12:19
问题 Can I pass an array into a Google App Script method from a Google Spreadsheet? Suppose I have an App Script function that expects a list with two elements (note: this example is just an example so please do not tell me that my problem would be solved if I simply passed each element as a separate argument). How do I call this function from a Google Spreadsheet cell? I've tried both: '=myFunc([1,2])' and '=myFunc((1,2))' and both give me a Parse Error. 回答1: In a spreadsheet formula, you can

Can I pass an array into a Google App Script method from a Google Spreadsheet?

余生颓废 提交于 2021-01-24 14:10:09
问题 Can I pass an array into a Google App Script method from a Google Spreadsheet? Suppose I have an App Script function that expects a list with two elements (note: this example is just an example so please do not tell me that my problem would be solved if I simply passed each element as a separate argument). How do I call this function from a Google Spreadsheet cell? I've tried both: '=myFunc([1,2])' and '=myFunc((1,2))' and both give me a Parse Error. 回答1: In a spreadsheet formula, you can