Automation rules as fast as calculation

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)
3 Likes

Hi Ryan,

Welcome to Coda!

Two general comments

  • Comment 1: You seem to look for something where a formula is applied, except when the user has entered something in a cell. Coda does not have that functionality, and I have not seen anybody request that yet. Several of your examples are falling into this category. (Examples 1, 2 and 5.)
  • Comment 2: Why do you want these calculations to be performed via automation? Automations by its nature is not immediate, where formulas are. All your examples could be reworked to use formulas, once you have gotten around the problem of whether a column is an input or formula column. So to do example 1, I would have one pair combination to be the maintained one. e.g. CAD/USD, and then calc and display the inverse in a second column. (From my accounting background, it is never a good idea to manually maintain both relationships. You ALWAYS run into rounding problems.)

It might be possible to implement your example 5 using two sets of columns for each value (Start, end duration), one for input, the other for calculation. Then you would use an If statement as part of the formula to copy whatever the user have entered and if he has not entered anything, to calculate the value.
The fun and games will start when the user changes which column he wants to have the input value added into, or if he enters all three values…

Regards
Piet