custom-function

Custom function won't refresh as inputs are changed

痞子三分冷 提交于 2020-06-17 14:01:09
问题 I have a custom function that finds the value of another cell and displays it. When the source cell is changed, the function does not reflect. https://docs.google.com/spreadsheets/d/1wfFe__g0VdXGAAaPthuhmWQo3A2nQtSVUhfGBt6aIQ0/edit?usp=sharing Refreshing google sheets function findRate() { var accountName = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange(1,1).getValue(); //determine the account name to use in the horizontal search var rateTab = SpreadsheetApp

What amount of JsDoc is supported in Google Sheets custom functions?

痞子三分冷 提交于 2020-06-06 08:27:07
问题 Google implies that JsDoc is supported: Custom functions will appear in this list if their script includes a JsDoc @customfunction tag, as in the DOUBLE() example below. https://developers.google.com/apps-script/guides/sheets/functions But it doesn't seem that JsDoc is supported in full, and I can't find the documentation that shows what is supported and not. I'm particularly looking for a way to document that a parameter for a custom function is optional . Like this, for value2: Image

Service invoked too many times in a short time: exec qps. - Google Sheets

别说谁变了你拦得住时间么 提交于 2020-05-31 04:22:35
问题 I have been using custom functions to break out simple mathematics into readable JavaScript, but am getting the following error: Service invoked too many times in a short time: exec qps. Try Utilities.sleep(1000) between calls. (line 0). I have tried sleeping for a random time, but that doesn't help. My functions look like this: function conversationGrowthRate(clientCount, initialGrowthRate, conversationCount) { //Utilities.sleep(Math.random() * 30000); for (var i = clientCount; i > 10; i--)

Service invoked too many times in a short time: exec qps. - Google Sheets

若如初见. 提交于 2020-05-31 04:20:59
问题 I have been using custom functions to break out simple mathematics into readable JavaScript, but am getting the following error: Service invoked too many times in a short time: exec qps. Try Utilities.sleep(1000) between calls. (line 0). I have tried sleeping for a random time, but that doesn't help. My functions look like this: function conversationGrowthRate(clientCount, initialGrowthRate, conversationCount) { //Utilities.sleep(Math.random() * 30000); for (var i = clientCount; i > 10; i--)

RMSE/ RMSLE loss function in Keras

[亡魂溺海] 提交于 2020-05-24 17:20:38
问题 I try to participate in my first Kaggle competition where RMSLE is given as the required loss function. For I have found nothing how to implement this loss function I tried to settle for RMSE . I know this was part of Keras in the past, is there any way to use it in the latest version, maybe with a customized function via backend ? This is the NN I designed: from keras.models import Sequential from keras.layers.core import Dense , Dropout from keras import regularizers model = Sequential()

How to use a custom function with an ArrayFormula

会有一股神秘感。 提交于 2020-03-26 05:20:09
问题 I want to write a function that can be used inside an ArrayFormula. My table is like this: | A | B | C | 1| a | | | 2| b | | | 3| c | | | First I wrote a simple function to return the input (so I know it works inside the ArrayFormula): function retAddress(cell){ return cell; } On B1 I wrote =ArrayFormula(retAddress(address(row(B:B),column(A:A),4))) and apparently it worked as expected, it returned each address, like this: | A | B | C | 1| a | A1| | 2| b | A2| | 3| c | A3| | Now, on column C,

How to use a custom function in an ARRAYFORMULA for a range of cells?

陌路散爱 提交于 2020-02-23 07:01:46
问题 I have a Google Form that is populating a Google Sheet. Due to having custom formulas in the sheet to manipulate the data populated from the form I am using ARRAYFORMULA to apply to all rows in a column. I have a custom function to encode rows containing html function base64EncodeWebSafe(input) { try { // Try and fetch the specified url. return Utilities.base64EncodeWebSafe(input); } catch (e) { Utilities.sleep(1000); return Utilities.base64EncodeWebSafe(input); } } When I call this function

Use custom MD5 formula with ARRAYFORMULA

六月ゝ 毕业季﹏ 提交于 2020-01-15 03:43:06
问题 I implemented an MD5 formula as mentioned here: Hash of a cell text in Google Spreadsheet. function MD5 (input) { var rawHash = Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, input); Utilities.sleep(100) var txtHash = ''; for (i = 0; i < rawHash.length; i++) { var hashVal = rawHash[i]; if (hashVal < 0) { hashVal += 256; } if (hashVal.toString(16).length == 1) { txtHash += '0'; } txtHash += hashVal.toString(16); } return txtHash; } Now I want to run this with an ARRAYFORMULA but I can

Set Maps API key in Script Editor

不羁岁月 提交于 2020-01-11 03:09:07
问题 As far as I understand, in order to track our quota usage, we need to provide our API key to the Google App Service on the service we are planning to use. In my case I have a spreadsheet with Origin and Destination and a Custom function to calculate the distance between. I ran into the problem of meeting the quota from invoking .getDirections() : Error: Service invoked too many times for one day: route. (line **). Sample of the code: function getDirections_(origin, destination) { var

IMPORTJSON custom function google sheets

百般思念 提交于 2020-01-06 05:10:46
问题 /** * Imports JSON data to your spreadsheet Ex: IMPORTJSON("http://myapisite.com","city/population") * @param url URL of your JSON data as string * @param xpath simplified xpath as string * @customfunction */ function IMPORTJSON(url,xpath){ try{ // /rates/EUR var res = UrlFetchApp.fetch(url); var content = res.getContentText(); var json = JSON.parse(content); var patharray = xpath.split("/"); //Logger.log(patharray); for(var i=0;i<patharray.length;i++){ json = json[patharray[i]]; } //Logger