google-apps-script

Copy data to a separate file when submitted

旧巷老猫 提交于 2021-01-28 21:48:48
问题 I'm wondering if when submitted, the data can be pasted to another separate file (and not tab). Do you think that there's a way? You can access the file here : https://docs.google.com/spreadsheets/d/1FFlsfFyVyQobnbfAgQZA_r5IQeBhgOdK4cBpi5yo77U/edit?usp=sharing Following code: function myFunction(){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var inputS = ss.getSheetByName("Input"); var outputS = ss.getSheetByName("Output"); var inputRng = inputS.getRange("A2:I2"); var values = inputRng

GAS Libraries Fatal Flaw: “Library with identifier FOO is missing (perhaps it was deleted?)”

点点圈 提交于 2021-01-28 21:38:25
问题 Question: Does anyone else experience this problem? And if so, what is the solution or my best course of action? Problem Statement: Libraries Fatal Flaw: "Library with identifier FOO is missing (perhaps it was deleted?)" + "We're sorry, a server error occurred. Please wait a bit and try again." Please provide a short description of the issue: Running any function in my GAS project results in the following error message: "Library with identifier FOO is missing (perhaps it was deleted?)" If I

Is it possible to further reduce the cost of the request with Google sheets api v4 in setValue and setNumberFormat?

这一生的挚爱 提交于 2021-01-28 21:28:44
问题 Now I use the code below to format and insert values. function AddName () { const range1 = ['Q4:Q','S4:S','U4:U','W4:W','Y4:Y','AA4:AA','AC4:AC','AE4:AE', 'AG4:AG','AI4:AI','AK4:AK','AM4:AM','AO4:AO','AQ4:AQ','AS4:AS','AU4:AU','AW4:AW','AY4:AY','BA4:BA', 'BC4:BC','BE4:BE','BG4:BG','BI4:BI','BK4:BK','BM4:BM','BO4:BO','BQ4:BQ','BS4:BS','BU4:BU','BW4:BW', 'BY4:BY','CA4:CA','CC4:CC','CE4:CE','CG4:CG','CI4:CI','CK4:CK','CM4:CM','CO4:CO','CQ4:CQ','CS4:CS', 'CU4:CU','CW4:CW','CY4:CY','DA4:DA','DC4

Appending row with checkbox in google scripts

♀尐吖头ヾ 提交于 2021-01-28 21:14:16
问题 Im writing a small google script for an excel sheet which appends a row on a POST request: depending on the POST parameters I either append the row to the end, or I insert it in between rows. One of the columns of the is actually a boolean that Im trying to represent as a checkbox. The problem is when I try to append a row sheet.appendRow([e.parameter.parameter1, e.parameter.parameter2, "FALSE"]); It simply writes false in that column. On the other hand when I insert a row in between other

IMPORTHTML() doesn't work in this webpage structure

会有一股神秘感。 提交于 2021-01-28 21:11:29
问题 I want to import data from a table within an HTML page. I applied Google's example IMPORTHTML("http://en.wikipedia.org/wiki/Demographics_of_India","table",4) to my case, changing various parameters, but it doesn't work after all. Could anyone tell me what is wrong with my following formula? =IMPORTHTML("https://s.cafef.vn/screener.aspx#data","table",1) I want to import the table from https://s.cafef.vn/screener.aspx#data The first 2 rows of the table look like: 1 Công ty cổ phần 32 A32 UpCom

Failed to execute PostMessage on DOMWindow using apps script

為{幸葍}努か 提交于 2021-01-28 20:48:45
问题 I am getting the following error message occasionally when I open my web-app with apps script. Need to clarify two questions What is this error? How do I fix it? I need this website to run consistently obviously so I am willing to start a bounty in a few days if the solution is not obvious. I make many calls to google.script.run functions. Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://n-j3xfpwqmogabbvlhsvezfcvbljow7bq45m6qoky-0lu-script.googleusercontent

I need to save a copy of a google spreadsheet to a specific directory using script

≯℡__Kan透↙ 提交于 2021-01-28 20:43:38
问题 We currently have a nightly balancing process wherein we open an Excel template spreadsheet, enter the correct processing date, and then click a button, causing a VB script to fire off and create a new copy of the spreadsheet with the appropriate name (eg, "BAL 080114") in the appropriate folder and opens it, at which point the operator then closes the template, and continues work in the new copy. The folder structure is: Drive --->Ops Room ------->Procedural Sheets ----------->Night Shift --

How to set a time-driven (clock) trigger for a function that needs parameters sent to it?

好久不见. 提交于 2021-01-28 20:23:22
问题 I'm trying to have a function run with a time-driven (clock) trigger. My issue is, the function needs variables sent to it as parameters. Normally if I'm not using a trigger I'll just send it directly like this. <script> function runFunction(){ google.script.run.myFunction(x,y,z); } </script> And on the server side, I'll call them easily. function myFunction(x,y,z){ var a = x; var b = y; var c = z; Logger.log(a+b+c); } But when I'm using a time-driven (clock) trigger to run the function how

Google sheets easily put a similar sheet name in a variable

孤人 提交于 2021-01-28 19:23:10
问题 May I ask if there is a way for me to easily put all the sheet name (well, most likely SF2 sheet) in this variable? I do have like 10 similar SF2 sheets. var sheetNames = ["School Form 1 (SF1)", "SEPT-School Form 2 (SF2)", "OCT-School Form 2 (SF2)", "OCT-School Form 2 (SF2)", ........, "School Form 5 (SF5)"]; I'm currently working in hiding rows. Here's the code: var startRow = 11; var colToCheck = 2; // This script is the same with your "HideRows". function script_HideRows() { var sheetNames

LockService: How do I lock a Google sheet from within a script?

孤者浪人 提交于 2021-01-28 18:42:51
问题 I'm using a Google spreadsheet to store contact info I collect from a website (GDPR compliant, don't worry) and I synchronize this sheet with Mailchimp using a custom App script, which runs in the background. More in detail, I'm using a temporary sheet as a buffer which is filled with the data users send via the site's forms (I'm using Contact Form 7 Google Sheets Connector). My script runs each time the event INSERT_ROW is triggered in the "buffer" sheet. It analyzes the data, stores them in