custom-function

Using a Custom Function in a Google Spreadsheet?

烈酒焚心 提交于 2019-12-06 10:45:26
I'm trying to figure out how I can write and run a custom function in a Google spreadsheet and I've been following this google tutorial . However at the time of this posting, I fear that this tutorial is out of date. I followed the steps, but see no way to access my in2mm function from within the spreadsheet that I started at. The tutorial suggests the following to make it show up You can manually start the scan by going to Tools > Script Manager... and clicking the Reload button. However, no such menu item exists. Just cut off in that screenshot is a "Script Center Menu", which has just one

Custom parsing function PHP

只愿长相守 提交于 2019-12-05 23:08:22
I'm trying to remove eval from the following function. I tried with sprintf and ${} , but still cannot find a solution. Here the function: function parseDbString(string $value = 'Looking for a good {{ $pippo }}'){ $pippo='Pizza'; return preg_replace_callback('/{{(.*?)}}/', function($res) use ($pippo) { // $val=${trim($res[1])}; Returns "Undefined variable: $pippo" $val=@eval("return ".trim($res[1]).";"); // Returns "Looking for a good Pizza" return isset($val) ? $val : $res[0]; },$value); } So, yes, eval() is often detested as one of the highest order "evils" in php. In most cases, when a task

Calling a Google App Script library from a Google spreadsheet cell

纵然是瞬间 提交于 2019-12-05 12:23:52
Trying out the new library feature in a Google spreadsheet. I have include a library with the identifier of "Test" and the library implements the function "foo()" entering =Test.foo() into a spreadsheet cell gives the error : "unknown function name TEST.FOO" If I create a function in my spreadsheet to wrap the library function: function foo() { return Test.foo(); } then use =foo() in my speadsheet cell, all is well. Creating wrapper functions for all library functions so they can be used in a spreadsheet cell makes using libraries less than ideal. Is there a way to call a library function from

To exceed the ImportXML limit on Google Spreadsheet

隐身守侯 提交于 2019-12-03 14:02:38
问题 I am stucking on a "scraping problem" right now. Especially i want to extract the name of the author from a webpage to google spreadsheet. Actually the function =IMPORTXML(A2,"//span[@class='author vcard meta-item']") is working, but after i raise the amount of links to scrape it just starts to load endless. So i researched and find out, that this problem is due to the fact, that there is a limit of google. Does anybody know of to exceed the limit or a script, which i could "easily copy" ? -

To exceed the ImportXML limit on Google Spreadsheet

江枫思渺然 提交于 2019-12-03 03:56:22
I am stucking on a "scraping problem" right now. Especially i want to extract the name of the author from a webpage to google spreadsheet. Actually the function =IMPORTXML(A2,"//span[@class='author vcard meta-item']") is working, but after i raise the amount of links to scrape it just starts to load endless. So i researched and find out, that this problem is due to the fact, that there is a limit of google. Does anybody know of to exceed the limit or a script, which i could "easily copy" ? - i really do not have a hunch of coding. I created a custom import function that overcomes all limits of

JSDoc for showing optional arguments in Google Sheets autocomplete dropdown

眉间皱痕 提交于 2019-12-02 03:12:36
I'd like to document (in the Google Sheet autocomplete) a custom function with optional arguments, similar to the WEEKDAY function (autocomplete below). The JSDoc spec on optional arguments does not work. Google does not seem to document this anywhere. How can I create a function with the same visual treatment (both in the argument description and the Example) that Google has? /** * Summary of function * @param {"example"} arg Argument description * @param {"optional"} opt_arg This argument is optional * @return {String} Return value description * @customfunction */ function JSDOC(arg, opt_arg

Google Apps Script to VMerge tables WITH FORMATTING

[亡魂溺海] 提交于 2019-12-01 13:34:54
Does anyone know if there is a Google apps script out there that does what VMerge does but keeps the formatting of the tables being merged together? (in Google Spreadsheets) VMerge is a script that can be used as a custom formula but a script that I can trigger myself will do just fine too. Any help would be much appreciated. If you need a separate script to bring over the formatting... function myFunction() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = ss.getSheetByName('Sheet1'); s.getRange('A1').copyFormatToRange(sheet, column, columnEnd, row, rowEnd); } VMerge expects arrays-of

How to add “custom function help” to a google spreadsheet. - not the script editor

老子叫甜甜 提交于 2019-12-01 04:51:57
It is possible to add "custom function help" to a google spreadsheet? i.e. If I type =sum into a spreadsheet cell, I get floating help text, is there a way to do this with custom functions? Documentation in google apps script is created using JSDoc http://en.wikipedia.org/wiki/JSDoc style (JavaDoc like) comments. as documented here https://developers.google.com/apps-script/guide_libraries?hl=en#guidelines it looks like these only work in the script editor. It there a way of adding documentation so it appears on the spreadsheet. This capability was added in May 2014, and the previous Issue 2475

How to get the file URL from file name in Google Sheets with correct Authorization via custom function/script

蹲街弑〆低调 提交于 2019-11-30 09:59:55
问题 I would like to create a custom function that pulls a Drive URL from a file name in Google Sheets. So, using the code below: If I have a valid file name in cell A1 The function =getFile(A1) would return the URL When I run my script from within the script editor, the return value works. When I run the function getFile() from within my sheet, I get the error below. My code: function getFile(cell) { var filename = encodeURI(cell); var url = "https://www.googleapis.com/drive/v3/files?fields=files

Spark Scala - How to group dataframe rows and apply complex function to the groups?

女生的网名这么多〃 提交于 2019-11-30 05:55:07
i am trying to solve this super simple problem and i am already sick of it, I hope somebody can help my out with this. I have a dataframe of shape like this: --------------------------- | Category | Product_ID | |------------+------------+ | a | product 1 | | a | product 2 | | a | product 3 | | a | product 1 | | a | product 4 | | b | product 5 | | b | product 6 | --------------------------- How do i group these rows by category and apply complicated function in Scala? Maybe something like this: val result = df.groupBy("Category").apply(myComplexFunction) This myComplexFunction should produce