Request for CFLFormulas

With packs we can reduce many lines of code to one simple to use pack function. It also allows to hide the code from the doc maker. This can be nice if you don’t want to share how a function works, or because a function is very complicated, of because it contains account information or tokens, or…

It would be so nice if we could use CFL the same way we use pack formulas. You could build a complete repository of complex CFL functions containing complex calculations available for your entire team (and for yourself). No more reinventing the wheel in every new doc, no more duplicating code. Editing a complicated CFL formula only once and see the effect of your edits in all the places where you used your own CFLFormula - in one doc or in many docs.

What I hope for is something like: myFunction(var 1, var 2, var 3…) (just like a pack function, but as far as I am concerned, without having to embed a pack in (all the) doc(s) where you want to use your favorite functions).

The parameters can be thisRow.tablecolumns, named formulas, text or numbers, control values or whatever we want to use in your CFLFormula. In the CFLFormula, a new coda object type would be written something like v1, v2, v3… and receive the formula parameters. It would be extremely convenient if we don’t have to define these variables, but that they are already available (say a max of 10 or 20 variables per function). But having to define them in the CFL functions would be OK too.

Although I realize this can be done with packs, CFL is so much more flexible and easier to write than pack code, it would allow for complex functionality to be build first in a doc (easy testing, no compiling necessary) and than copy it to a CFLFormula where you only have to change the parameter variables.

Since many API’s can be addressed with one URL, simple API calls might be made possible too?

1 Like