google-apps-script

Why does Logger.log statements not show up in Logs?

我是研究僧i 提交于 2020-12-15 19:31:11
问题 I've just transitioned to V8 of google apps script. I'm updating my previous scripts. all of my Logger.log("Hello World"); statements behave differently. Previously i could hit ctrl+enter which would bring up the "Logs" screen. Currently those logger statements don't show up there and I get a message that "No Functions have been run in this editor session". I am able to open the executions screen and find the Logger statements there. The problem with that few is it only time stamps to the

Why does Logger.log statements not show up in Logs?

邮差的信 提交于 2020-12-15 19:30:57
问题 I've just transitioned to V8 of google apps script. I'm updating my previous scripts. all of my Logger.log("Hello World"); statements behave differently. Previously i could hit ctrl+enter which would bring up the "Logs" screen. Currently those logger statements don't show up there and I get a message that "No Functions have been run in this editor session". I am able to open the executions screen and find the Logger statements there. The problem with that few is it only time stamps to the

Get all the ID of the files

非 Y 不嫁゛ 提交于 2020-12-15 06:42:29
问题 I'm working on a folder per grade level with the same content. I used the IMPORT RANGE function to connect the spreadsheets. So I need to update the IDs every time I create another grade level. May I ask if it is possible for me to get all the IDs of all the files that I'm working on without editing or typing them one by one? Maybe a script that can make it easier? Here's the picture of the list of IDs. If it is possible, the flow I’m thinking of is to get the filename of the files and then

Get all the ID of the files

試著忘記壹切 提交于 2020-12-15 06:41:30
问题 I'm working on a folder per grade level with the same content. I used the IMPORT RANGE function to connect the spreadsheets. So I need to update the IDs every time I create another grade level. May I ask if it is possible for me to get all the IDs of all the files that I'm working on without editing or typing them one by one? Maybe a script that can make it easier? Here's the picture of the list of IDs. If it is possible, the flow I’m thinking of is to get the filename of the files and then

Required permissions: https://www.googleapis.com/auth/spreadsheets

半城伤御伤魂 提交于 2020-12-15 06:11:48
问题 I've created a simple code on appscript to get Google Drive file names out of the URL function FileName (URL) { var ss = SpreadsheetApp.openByUrl(URL); return ss.getName(); } When I run that I get an error: Exception: You do not have permission to call SpreadsheetApp.openByUrl. Required permissions: https://www.googleapis.com/auth/spreadsheets (linha 6). I've already enabled Drive and Sheets API in the Advanced Google Services area, so the "https://www.googleapis.com/auth/spreadsheets" should

How to hide columns in Google Sheet with checkboxes

ε祈祈猫儿з 提交于 2020-12-15 06:02:42
问题 Could someone help me figure out how to be able to hide/unhide columns by using a checkbox in Google Sheets. For example, the checkbox is located in N4 and I want to hide/unhide column from O to R : Thank you! 回答1: Answer: You need to use an onEdit() trigger. Code Sample: function onEdit(e) { if (e.range.getA1Notation() != "N4") return; if (e.value == "TRUE") { SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().hideColumns(15, 4); } else if (e.value == "FALSE") { SpreadsheetApp

How to hide columns in Google Sheet with checkboxes

帅比萌擦擦* 提交于 2020-12-15 06:01:11
问题 Could someone help me figure out how to be able to hide/unhide columns by using a checkbox in Google Sheets. For example, the checkbox is located in N4 and I want to hide/unhide column from O to R : Thank you! 回答1: Answer: You need to use an onEdit() trigger. Code Sample: function onEdit(e) { if (e.range.getA1Notation() != "N4") return; if (e.value == "TRUE") { SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().hideColumns(15, 4); } else if (e.value == "FALSE") { SpreadsheetApp

google web app script - global variable on client side

耗尽温柔 提交于 2020-12-15 05:41:30
问题 I have a WebApp which takes some values from a google sheet when it is opened. I want to store a global variable so that I do not have to make a call to the server all the time I need that variable. I checked several questions online, but I am still not able to make it work. Below is an extract of my code with a tentative to use PropertiesService. However it gives me an error that PropertiesService is not defined. What is the easiest way to store a variable and use it in different functions

google web app script - global variable on client side

孤者浪人 提交于 2020-12-15 05:41:27
问题 I have a WebApp which takes some values from a google sheet when it is opened. I want to store a global variable so that I do not have to make a call to the server all the time I need that variable. I checked several questions online, but I am still not able to make it work. Below is an extract of my code with a tentative to use PropertiesService. However it gives me an error that PropertiesService is not defined. What is the easiest way to store a variable and use it in different functions

Google Script: Failed request and returned code 500

一笑奈何 提交于 2020-12-15 05:21:48
问题 I'm experiencing an error called code 500 . The script works fine if I'm using it in the owner account, but if I'm going to open the file as a user/editor, the code 500 error shows. Here is the link to the sample spreadsheet that I'm working on. I tried asking here but seems like it is a little complicated so I created a new single spreadsheet so that it can be easily identified the error. Here's the code function doGet(e) { this[e.parameter.run](e.parameter.sheetName || null); return