google-apps-script

Google Sheets: Hide rows in multiple sheets

亡梦爱人 提交于 2021-02-11 12:41:23
问题 I'm trying to hide rows across a multiple sheets. So I have a 6 sheets, but there are 4 similar sheets, the other one is more likely a summary of that 4 sheets and the other one is the sheet with a button. Here's a sample for your reference: LINK It is working if I will put a HIDE ROWS button on sheets one by one, but it will take a lot of time for me to do it since I need to put it on different spreadsheets. My idea is to put a button per spreadsheet or upon opening it, the rows that are

Google Form AppScript - Item choices disappear when viewing, however it's showing in editing view?

痞子三分冷 提交于 2021-02-11 12:32:25
问题 I created an add-on to import questions & choices as multiple choice items in Forms. The questions, answers & correct answer were imported perfectly and shows as expected in editing view, however when previewing the form/quiz, some questions have choices missing. Any ideas? function createMCQ(k) { var form = FormApp.getActiveForm(); form.setIsQuiz(true) .setShuffleQuestions(true) .setAllowResponseEdits(false) .setLimitOneResponsePerUser(false) .setCollectEmail(true) .setShowLinkToRespondAgain

How to use conditional formatting in Google sheets api v4

倾然丶 夕夏残阳落幕 提交于 2021-02-11 12:30:01
问题 Good day. Please tell me how I can convert this script to use Google sheets api v4 and reduce the cost of the request. Understand correctly that I need to dig to the side: https://developers.google.com/sheets/api/samples/conditional-formatting?hl=en#add_a_conditional_formatting_rule_to_a_set_of_ranges ? Sample code below while (folders.hasNext()) { var folder = folders.next().getId(); var sheet1 = SpreadsheetApp.openById(folder); var sheet = sheet1.getActiveSheet(); var r1 = sheet.getRange(

how to print a long Goggle sheets column in fewer columns

泪湿孤枕 提交于 2021-02-11 12:20:02
问题 I have a google sheet with two long columns(image 1) of results(say 1 up to 1500 records) and column 2 I have QR codes generated by a formula. Now I need to export or print it to a pdf file, but I like to break the long columns so that the pdf file is filled with 8 columns(image 2) so that there is no paper wasted when printed. As it is, if print the page it would give me a lot of empty space. 回答1: From what I understand, you are trying to break the 1 long column into 4 columns. The following

how to print a long Goggle sheets column in fewer columns

笑着哭i 提交于 2021-02-11 12:18:06
问题 I have a google sheet with two long columns(image 1) of results(say 1 up to 1500 records) and column 2 I have QR codes generated by a formula. Now I need to export or print it to a pdf file, but I like to break the long columns so that the pdf file is filled with 8 columns(image 2) so that there is no paper wasted when printed. As it is, if print the page it would give me a lot of empty space. 回答1: From what I understand, you are trying to break the 1 long column into 4 columns. The following

Is there any way so that I can search value upwards?

泄露秘密 提交于 2021-02-11 12:08:24
问题 I was wondering if anyone knows whether it is possible or not to search a value upwards instead of the usual up to down in a column. The reason why I'm asking is because I'm currently preparing a visitor sheet which will be recorded into Google Sheets, that comes from Google Forms. Each visitor will be given an ID/Pass number which will be used to record their entry and exit time. The problem now is that, if two people uses the same ID, it will change only the entry and exit time of the

How do I speed up Sheet load times with a lot of importranges?

痞子三分冷 提交于 2021-02-11 09:49:51
问题 I've been promoted into developing & maintaining a Google Sheets database at work. I know very little about Google Sheets scripting & from asking around, and researching it's looking like GAS is probably the avenue that I need to start heading down. So we have 3 Workbooks in Google Sheets; 2 contain large amounts of data, the other workbook provides a UI for our sales dpt. to access the data. I really wish I could share these with you, as describing them is difficult. In the UI workbook,

Is JavaScript function.bind() supported in google sheets?

余生颓废 提交于 2021-02-11 08:04:33
问题 Here a simple code i'm trying to run in google sheets script. The purpose is supplying the foreach callback function additional parameters. function print(str, num) { Logger.log(str + ": " + num); } function test() { var array = [1,2,3]; var str = "Stam"; //This line has an exception // TypeError: Cannot convert null to an object array.forEach(print.bind(null, str)); } test(); this code is based on the solution described here. I know there are other solutions, though i want to understand why

getUserTriggers() Returns Empty Array Even Though Trigger Exists

孤街浪徒 提交于 2021-02-11 07:52:00
问题 I have a weird problem. I am trying to understand how this trigger function actually works in Gapps: getUserTriggers() https://developers.google.com/apps-script/reference/script/script-app#getusertriggersspreadsheet I am using this very simple piece of code used as script within a spreadsheet: function testing(){ var ss = SpreadsheetApp.openById('some id'); var triggers = ScriptApp.getUserTriggers(ss); // Log the event type for the first trigger in the array. Logger.log(triggers[0]

Handling multiple rows returned by IMPORTJSON script on GoogleSheets

时间秒杀一切 提交于 2021-02-11 07:42:34
问题 I am trying to populate a google sheet using an API. But the API has more than one row to be returned for a single query. Following is the JSON returned by API. # https://api.dictionaryapi.dev/api/v2/entries/en/ABANDON [ { "word": "abandon", "phonetics": [ { "text": "/əˈbændən/", "audio": "https://lex-audio.useremarkable.com/mp3/abandon_us_1.mp3" } ], "meanings": [ { "partOfSpeech": "transitive verb", "definitions": [ { "definition": "Cease to support or look after (someone); desert.",