google-sheets

Dates (Duration) in Google Sheets Script

女生的网名这么多〃 提交于 2021-02-08 06:14:28
问题 I have a Google Sheet with three columns: - Date and time (timestamp) - Duration - Description I have an script that when I write something in 'Description', inserts in 'Date' the date and time at this moment, and the 'Duration': function onEdit(e) { if(e.source.getActiveSheet().getName() == "Sheet2" ) { var col = e.source.getActiveCell().getColumn(); if(col == 3 ) { // I'm in column three var cellTimeStamp = e.range.offset(0,-2); // First column of the same row var cellTimeDiff = e.range

How to Hide Images in Google Spreadsheets with Google Apps Script?

若如初见. 提交于 2021-02-08 05:41:43
问题 I'm building a dashboard in Google Spreadsheets and want to include some images to be shown when certain rows are hidden/shown. Is this possible? I've used insertImage to insert the image but I can't find a way to delete or hide the image (hiding the rows does not affect images). Any ideas? 回答1: There is no straightforward way of removing an image from the Apps Script API. Even if you delete a row, the image will still remain. You should raise a request for this feature in the Issue Tracker (

Google Script Export Spreadsheet to XML File

假装没事ソ 提交于 2021-02-08 05:34:51
问题 I am trying to create a menu button in my Google Spreadsheet that runs a script. This script should extract specific rows and columns, then export them to an XML file. I am trying to write the xml file using the ContentService, but it does not seem to work. Is there an example or tutorial that can help? Thanks 回答1: Are you getting any error messages? Or, what specifically is not working? I've just tested it and it seems fine, here's my snippet function doGet(e) { var content; try { content =

How Do I create an Installable Trigger on a specific Deployment from Standalone Script With Event Source Spreadsheet?

Deadly 提交于 2021-02-08 05:05:09
问题 Background: I have been learning Google Apps script, and now have a working standalone Google Apps Script project, just for personal use, in which I have created an Installable Trigger that is configured with Event Source: "From Spreadsheet", creating it programmatically (I was unable to find a way to create this trigger through the web interface (Edit menu --> Current project's triggers) since the event source drop-down only shows "timed" and "From Calendar" as selections). A few weeks back

Google Apps Script in Google Sheet - Convert formulas to static values - cell function to value

假装没事ソ 提交于 2021-02-08 04:44:23
问题 Is there a Google Apps Script method that will change a cell with a formula to one with a static value? The reason for this is to avoid lag in the Sheet from lots of cell formulas recalculating as the sheet becomes larger. I want to make the sheet replace old formulas with static values since they won't be changing. 回答1: Use the copyValuesToRange() method: function copyFormulasToValues() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sourceSheet = ss.getSheetByName("Sheet1"); var

Increase my script performance Google Sheets Script

只愿长相守 提交于 2021-02-08 03:14:59
问题 I created a function that whenever I run the AppendRow script every row that does not have a dot (".") at the AY column, an array with every information/column that I want from that sheet will be transfered to my main sheet that has around 13k rows atm. Usually about 20-40 rows get pasted into the first sheet everyday and this script automatically re-arranges the columns to my main sheet. PROBLEM: The problem is that each row that gets appended to my main sheet takes around 8-15sec to get

Increase my script performance Google Sheets Script

吃可爱长大的小学妹 提交于 2021-02-08 03:10:14
问题 I created a function that whenever I run the AppendRow script every row that does not have a dot (".") at the AY column, an array with every information/column that I want from that sheet will be transfered to my main sheet that has around 13k rows atm. Usually about 20-40 rows get pasted into the first sheet everyday and this script automatically re-arranges the columns to my main sheet. PROBLEM: The problem is that each row that gets appended to my main sheet takes around 8-15sec to get

Increase my script performance Google Sheets Script

北城以北 提交于 2021-02-08 03:09:33
问题 I created a function that whenever I run the AppendRow script every row that does not have a dot (".") at the AY column, an array with every information/column that I want from that sheet will be transfered to my main sheet that has around 13k rows atm. Usually about 20-40 rows get pasted into the first sheet everyday and this script automatically re-arranges the columns to my main sheet. PROBLEM: The problem is that each row that gets appended to my main sheet takes around 8-15sec to get

Increase my script performance Google Sheets Script

左心房为你撑大大i 提交于 2021-02-08 03:08:27
问题 I created a function that whenever I run the AppendRow script every row that does not have a dot (".") at the AY column, an array with every information/column that I want from that sheet will be transfered to my main sheet that has around 13k rows atm. Usually about 20-40 rows get pasted into the first sheet everyday and this script automatically re-arranges the columns to my main sheet. PROBLEM: The problem is that each row that gets appended to my main sheet takes around 8-15sec to get

Sum array columns and store the results in a bidimensional array (Javascript)

随声附和 提交于 2021-02-07 20:43:08
问题 I'm using Google Sheets's Script Editor to operate between the values of a table/array. I've got a table that looks like this: | UserA | UserB | UserC | Movie1 | 2 | 8 | 6 | Movie2 | 4 | 6 | 0 | Movie3 | 5 | 2 | 3 | Movie4 | 2 | 7 | 2 | I need to sum every user's rating with the first user's rating, obtaining another array with the results of each sum. In this case, the result should be: | UserA+A | UserB+A | UserC+A | Movie1 | 4 | 10 | 8 | Movie2 | 8 | 10 | 4 | Movie3 | 10 | 7 | 8 | Movie4 |