google-apps-script

On Edit doesnt work if cell auto updates - Need a workaround Google Sheets

泄露秘密 提交于 2020-04-29 02:11:18
问题 This code works as intended when you manually change a cell. function onEdit(event) { // assumes source data in sheet named Prepsheet // target sheet of move to named TopUp Required var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = event.source.getActiveSheet(); var r = event.source.getActiveRange(); if(s.getName() == "PrepSheet" && r.getColumn() == 15 && r.getValue() == 0) { var row = r.getRow(); var numColumns = s.getLastColumn(); var targetSheet = ss.getSheetByName("TopUp Required");

On Edit doesnt work if cell auto updates - Need a workaround Google Sheets

只愿长相守 提交于 2020-04-29 02:07:19
问题 This code works as intended when you manually change a cell. function onEdit(event) { // assumes source data in sheet named Prepsheet // target sheet of move to named TopUp Required var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = event.source.getActiveSheet(); var r = event.source.getActiveRange(); if(s.getName() == "PrepSheet" && r.getColumn() == 15 && r.getValue() == 0) { var row = r.getRow(); var numColumns = s.getLastColumn(); var targetSheet = ss.getSheetByName("TopUp Required");

JDBC on Google Apps Script. Exception: Statement cancelled due to timeout or client request

こ雲淡風輕ζ 提交于 2020-04-28 09:59:22
问题 I am trying to fetch data from mySQL database on Google Cloud SQL using JDBC from Google Apps Script. However, I got this error: Exception: Statement cancelled due to timeout or client request I can fetch some other data successfully. However, some data I can't. I execute one of the successful queries and one of the unsuccessful queries on mySQL workbench. I can execute the unsuccessful query with no problem on mySQL workbench. I compared the durations. Duration / Fetch ----------------------

Copy values and formulas to a different sheet in google script

无人久伴 提交于 2020-04-21 15:54:35
问题 I am trying to copy the full data from one sheet to another including all the values and all the formulas. The problem I have is that I cannot find a function that does both setValues is just the values, setFormulas just the formulas. Is there a way to combine both of these into a single copy so all the information comes across. if it includes the formatting information that would be even better. Thanks 回答1: Would this help? It duplicates an entire sheet? https://developers.google.com/apps

How do I dynamically reference multiple sheets on Google SpreadSheets?

有些话、适合烂在心里 提交于 2020-04-19 13:53:51
问题 I use a Google SpreadSheet add-on to make Google Analytics Reports. My problem is that for each query this add-on creates a different sheet. I often have around 50 different sheet with data that must be compiled into a single sheet. For example: I might have 3 sheets named: "Organic Data", "Direct Data" and "Other Data" Each sheet has a different set of data that I want to compile into a single table in a 4th sheet called "Report". This table will have in its first column data from the

How do I dynamically reference multiple sheets on Google SpreadSheets?

怎甘沉沦 提交于 2020-04-19 13:49:51
问题 I use a Google SpreadSheet add-on to make Google Analytics Reports. My problem is that for each query this add-on creates a different sheet. I often have around 50 different sheet with data that must be compiled into a single sheet. For example: I might have 3 sheets named: "Organic Data", "Direct Data" and "Other Data" Each sheet has a different set of data that I want to compile into a single table in a 4th sheet called "Report". This table will have in its first column data from the

How do I dynamically reference multiple sheets on Google SpreadSheets?

試著忘記壹切 提交于 2020-04-19 13:47:31
问题 I use a Google SpreadSheet add-on to make Google Analytics Reports. My problem is that for each query this add-on creates a different sheet. I often have around 50 different sheet with data that must be compiled into a single sheet. For example: I might have 3 sheets named: "Organic Data", "Direct Data" and "Other Data" Each sheet has a different set of data that I want to compile into a single table in a 4th sheet called "Report". This table will have in its first column data from the

Replace Hyperlinks in Multiple Google Docs

久未见 提交于 2020-04-18 07:25:30
问题 I entered the following code posted by ziganotschka on https://stackoverflow.com/a/57865441/12252776: function myFunction() { var oldLink="http://www.googledoclink1.com"; var newLink="http://www.googledoclinkA.com"; var oldLink2="http://www.googledoclink2.com"; var newLink2="http://www.googledoclinkB.com"; var files = DriveApp.getFiles(); // Note: this gets *every* file in your Google Drive while (files.hasNext()) { var file = files.next(); Logger.log(file.getName()); var doc = DocumentApp

How to provide an API key for ssl-vp.com in a Google Sheets script?

点点圈 提交于 2020-04-18 07:13:50
问题 I'm trying to get JSON data from a URL and insert the data in the sheets of Google Sheets. The problem is when I try to get the data this response me that error: Error in the request for the returned code 401 of https://ssl-vp.com/rest/v1/Campaigns/1236223656534991/Recipients?by=ExternalId&page=1&itemsPerPage=500. Truncated server response: Unauthorized Cannot get campaign contacts (use the muteHttpExceptions option to examine the entire response) (line 15, file "Código") I try to insert the

Protect a cell for everyone except for function

别等时光非礼了梦想. 提交于 2020-04-18 06:47:19
问题 I am new to the world of apps script and I would like to know if is it possible to protect a cell for everyone(they can't change the value directly) but can be changed by a function that will be called by everyone ? Thanks edit: the user can't change direclty the cell but he has a button with a script which shloud be able to change the value of the protect cell but currently if I put the cell in "protect sheets and range" the script doesn't work 回答1: Yes, it is possible. First Option Use the