Would it be possible to have client-side (right term?) automation?
Related post:
Current automation is perfect for some use cases but very slow for others. I believe having automation rules that are instant (or at least comparable in speed to formula columns) would really open up utility in coda. In particular, providing special relationships between columns (and tables) that is currently not possible with formulae.
Examples
Example 1: Unit Conversion
A table of budget line items with two columns: one for the amount in USD and another with the amount in CAD. I would then “link” these two columns providing the two complementary formulae as instant automation rules:
thisRow.[CAD]*1.26
(for USD)thisRow.[USD]/1.26
(for CAD).
Now. when I edit the USD column, the CAD column immediately updates to match. And vice versa. Same idea for metric/imperial conversions, or things like “price per unit” vs “unit per price”, etc.
Example 2: Editable Reverse Lookup
I have a [Tasks] table and a [Projects] table. First I create a Project column in [Tasks], then I create the complimentary lookup column in [Projects] and “link” them with two complimentary formulae:
[Tasks].Filter(Project.Contains(thisRow))
[Projects].Filter(Tasks.Contains(thisRow))
Now, whenever I update the Project column of [Tasks], the corresponding Tasks column is updated in [Projects] and vice versa: whenever I update the tasks of any project, the project lookup column is updated in the tasks table.
Example 3: Self-Linked Column
In some cases, I may want to link a column to itself. The simplest version would be a column called Related Rows which I would link to itself using the formula: thisTable.Filter([Related Rows].Contains(thisRow))
. So every time I edit the “Related Rows” column of a row, the related rows also update at the same time.
Admittedly, haven’t thought through this example enough to know if it would actually be consistent or not.
Example 4: Self-Adjusting Cell
In some cases, it may be desirable to slightly edit a user’s input in a cell. Eg, trim whitespace, round a number, etc.
Example 5: Start, End, Duration (three-way link)
Sometimes you have three mutually restrictive variables, and you want the user to edit all three, but not be able to input non-sensical data (like an event that starts after it ends). I would link these columns with some automation rules likeso:
- Start:
thisRow.End - thisRow.Duration
(when End changes) - End:
thisRow.Start + thisRow.Duration
(when Duration changes) - Duration:
thisRow.End - thisRow.Start
(when Start changes)