Tana is launching a new product 🚀 Get early access

Comment #⁨12⁩

There is apparently already a 'formula' field. When you type the 'Set formula' command on a field, it's value become a computed value build from the result of the functions that you added in this field.
I coulnd't find any documentation about that feature. I just found some functions like: sum, average, min, max,... and I only managed to add 'hardcoded' values as parameters to these functions. What we need now is to be able to add the value of another field instead of hardcoded values. There is maybe a way to do so but I couldn't find how....
Screenshot 2023-07-21 at 09.35.48.png

  1. In reply to Julien France Julien France

    It looks like Tana does support more than simple fixed values via the "formula" method @Julien France pointed out; I did a bit more poking and was able to get some more out of it:

    https://ktemk.in/post/tana-formulae/

    Things formulas can do, from what I'm looking at, while live updating:

    • Use field values given anything you can craft a search query for (using e.g findInstance, filter, and lookup)
    • Use field values for a particular field in parent/child nodes
    • Use field values on any node that is used itself as a field value
    • Basic math (add, subtract, multiply, divide, average, min, max, count, rounding) on node contents / field values
    • Filter out duplicate references
    • Parse and format dates, to a degree
    • Get the first and last N items returned by a search
    • Combine disparate searches
    • Move up and down the parent/child tree
    • Count the length of a string or the number of emojis in it (???)

    ... and that's about it. There doesn't seem to be a way to get a substring, or choose based on conditions, or anything like that.

    edit: now, if there was the ability to specify an arbitrary javascript function to run instead of these preselected few, that would be 🔥