Locate formula errors

Recently, on a working Coda doc, I decided to make a change.

  1. Duplicated a Section containing a Table that I was referencing from several other formulas/tables.
  2. Made some experimental structure changes to the new table.
  3. When I was happy with the new table, I changed formulas to reference the new table instead of the old (this worked fine).
  4. Kept the original table/section around for a few weeks in case I needed to look at the original format of the data.
  5. Deleted the original table/section once I decided the new one worked properly and was a better fit for my doc.

A couple weeks went by before I was alerted that a lot of math in my doc was resulting in incorrect values. After some digging I realized that I forgot to update a couple (hidden field) formulas that were still referencing the original table I deleted. Unfortunately that meant that any field with an error was giving a “0” to my math and screwing everything up!!! It was relatively straightforward to modify the remaining formulas to reference the new table and fix the problem, but I’m worried I may have shaken confidence in Coda with my “team” (I’m getting questions about what this has done to the values).

What I’d like to know: is there a way to list broken formulas in a doc? What strategies are there to deal with this?



Just adding to your comment here.

I like your idea of listing broken formulas in a doc.

I’ve been grinding on this literally all day every day this week conducting a large refactor and performance optimization. I’ve been through three major refactors on this particular project.

The only way I know of to avoid the scenario you describe is to be extremely methodical while connecting the new and discarding the old. :bomb:

For tables I intend to delete, I use the Doc Map to review the table for dependencies. For a given table, it lists the objects referenced by it, to this level of detail:

  • Tables
  • Buttons & Controls
  • Formulas

Not very specific, especially if a complex table is referenced by another complex table. How to know which specific element is referencing which specific element? Short of having one’s logic structure committed to memory, the only way I know is to methodically go through each element of each table one by one until it’s found. That can be time consuming, to put it mildly. Multiply that by the number of references that must be tracked down. The hours spent! Wew! :sweat:

Refactoring is a fact of life. And it’s something that the user base is going to have to perform on a routine basis.

What would make the refactoring process much quicker and easier would be more specific dependency documentation. Even just going one level deeper on the “Referenced by” in the Doc Map would be a huge help. So, instead of stopping at Tables, Tables would contain the actual children that are referenced, such as Column, Table Filter, etc. Preferably with links, for jumping straight to them.

Mass refactorings are less frequent than common debugging and problem solving. Those too would be made much quicker and easier if the Table UI and Column UI offered immediate UI access to their precedents and dependents, again with links for jumping straight to them.




A suggestion was posted for this: