Hello all,
I am new to Coda and I’m trying to figure out how to be able to use “CurrentValue” as seen in FormulaMap, i.e.:
=List("Dog", "Cat").FormulaMap(Upper(CurrentValue))
I was able to use it when applying FormulaMap to a specific piece of data, e.g.:
=List("Dog", "Cat").FormulaMap(Upper(CurrentValue + "!"))
which produces “DOG!, CAT!”, as expected.
But now suppose that I have a really long utility formula that I want to be able to apply to different data sets. I don’t want to keep copying and pasting the same utility formula. To use the example formula from above, creating this as a formula (named or not) doesn’t work: =Upper(CurrentValue + "!"). It says that there is no reference called CurrentValue.
I then thought that maybe you need FormulaMap in order for the language to generate a CurrentValue reference. However, I am unable to do =FormulaMap(... because it expects two arguments (the data being operated on, and the formula to be applied). I couldn’t find any way to reference the current data being operated on, e.g. thisData. (When typing this, the only option it gave me was actual concrete data like thisDocument.)
My goal is to be able to, say, give this formula the name yell:
=Upper(CurrentValue.ToText() + "!")
And then use it across different data sets like so:
=List("Dog", "Cat").FormulaMap(yell)
=List("Whale", "Dolphin").FormulaMap(yell)
Note that I am having the same problem with Filter. I can’t seem to define a simple filter formula like so, to be used on various tables:
=Filter(CurrentValue > 1000000 AND CurrentValue < 5000000)
