google-apps-script

How to access to the google sheet the short cut ist pointing at?

孤街浪徒 提交于 2021-02-11 15:41:07
问题 [![enter image description here][1]][1]I have made a shortcut (new feature of google) of a google sheets. Now I want to get all the Spreadsheets I have in a directory: these function does not work anymore to treat all the Spreadsheet: folder.getFilesByType(mimeType) because the 'new' shortcut a new mime type has been introduced. The ID of the shortcut is different from the original file. You can not access anymore over ID of the files you find in the directory. What is the solution to select

Post through google app scripts

徘徊边缘 提交于 2021-02-11 15:38:24
问题 I am trying to post from a HTML form to a Google sheet. I am currently just trying to write the code in the Google App script but an error states "Script function not found: doGet" and I cannot figure out what to do. My code is below: function myFunction() { var SHEET_NAME = "Sheet1"; var SCRIPT_PROP = PropertiesService.getScriptProperties(); // new property service function doGet(e){ return handleResponse(e); } function doPost(e){ return handleResponse(e); } function handleResponse(e) { var

Post through google app scripts

旧街凉风 提交于 2021-02-11 15:37:26
问题 I am trying to post from a HTML form to a Google sheet. I am currently just trying to write the code in the Google App script but an error states "Script function not found: doGet" and I cannot figure out what to do. My code is below: function myFunction() { var SHEET_NAME = "Sheet1"; var SCRIPT_PROP = PropertiesService.getScriptProperties(); // new property service function doGet(e){ return handleResponse(e); } function doPost(e){ return handleResponse(e); } function handleResponse(e) { var

Post through google app scripts

不羁的心 提交于 2021-02-11 15:36:31
问题 I am trying to post from a HTML form to a Google sheet. I am currently just trying to write the code in the Google App script but an error states "Script function not found: doGet" and I cannot figure out what to do. My code is below: function myFunction() { var SHEET_NAME = "Sheet1"; var SCRIPT_PROP = PropertiesService.getScriptProperties(); // new property service function doGet(e){ return handleResponse(e); } function doPost(e){ return handleResponse(e); } function handleResponse(e) { var

Open Google Apps Spreadsheet by name [duplicate]

ⅰ亾dé卋堺 提交于 2021-02-11 15:26:46
问题 This question already has answers here : Open Google Docs Spreadsheet by name (3 answers) Closed 4 years ago . With a script I create a new Google Spreadsheet every day. I'm certain there is only one spreadsheet on the drive with this name, as I trash everything with the same name before creating a new one. But how can I open the spreadsheet with google apps script? I have no ID for the file. I have a small script so I can find the file: function myFunction() { // Log the name of every file

Fetching XML by Google App Script ends on Exceeded maximum execution time

自闭症网瘾萝莉.ら 提交于 2021-02-11 14:53:34
问题 I am trying to fetch XML by Google App Script and then passing these values to Google Sheets. Everything works fine for a few iterations. If I try more, I will exceed the maximum time of execution. The code below results in an error message "Exceeded maximum execution time". If I lower a number of iteration (3), It will work. But I need to iterate through approximately 20K rows. function myFunction(){ var url = '<<file name>>'; var bggXml = UrlFetchApp.fetch(url).getContentText(); var

Using triggers with custom functions on Google Apps Script

断了今生、忘了曾经 提交于 2021-02-11 14:50:21
问题 I had a prob with my script, which was greatly answered in this question. Basically custom functions cannot call services that require authorization. However, as far as I understood if I use simple triggers, such as onEdit it could work. I checked the documentation suggested in the previous question, however I wasn't successful applying that to my code, which you can see below: function FileName (id) { var ss = DriveApp.getFileById(id); return ss.getName(); } How could I adapt my code to use

Fetching XML by Google App Script ends on Exceeded maximum execution time

江枫思渺然 提交于 2021-02-11 14:50:07
问题 I am trying to fetch XML by Google App Script and then passing these values to Google Sheets. Everything works fine for a few iterations. If I try more, I will exceed the maximum time of execution. The code below results in an error message "Exceeded maximum execution time". If I lower a number of iteration (3), It will work. But I need to iterate through approximately 20K rows. function myFunction(){ var url = '<<file name>>'; var bggXml = UrlFetchApp.fetch(url).getContentText(); var

ImportHTML recalculation by the minute

房东的猫 提交于 2021-02-11 14:46:30
问题 Hi I am trying to get the data on my google sheet to be recalculate every minute by using this script. var sh = SpreadsheetApp.getActiveSheet(); var sheet = SpreadsheetApp.getActive().getSheetByName('Sheet1'); var r = "A1"; var f = '=ImportHTML("https://coinmarketcap.com/all/views/all/","table")'; sh.getRange(r).setFormula(f); Utilities.sleep(2000); sh.getRange(2,2,sh.getLastRow(),sh.getLastColumn()-1).setValues(sh.getRange(1,1,sh.getLastRow(),sh.getLastColumn()-1).getValues()); } but I got a

How to make a simple authentication in Google Forms using Google apps script?

时光怂恿深爱的人放手 提交于 2021-02-11 14:45:09
问题 Objective & Implementation I created a questionnair using Google Forms. I want to authenticate users using a simple one time password that should be entered in the first question. The password is stored inside a spreadsheet that contains only one cell. https://prnt.sc/r8i8q1 The script below reads the content of this cell and create a custom validator against the value of the first item of the form. function validatePassword() { var passwordSpreadsheet = "[passwords_spreadsheet_id]"; var ss =