Not a hack per se, just a smart way to speed up formula creation to copy a row (e.g. from the main table to a log table), using some regex.
Here’s a video how you can make such log table in 2 minutes:
Copy the table to a text editor or right into an offline / online editor that supports regular expressions (I prefer regex101.com, not affiliated). Remove everything but the headers
Set up replacement with regular expressions:
Search: ([^\t]+)\t?
(means capture each element between tabs)
Replacement: [\1], thisRow.[\1],
(means insert the captured column name twice, enclose in brackets)
Use replacement result in an .AddRow() formula.
One caveat: this won’t have newlines. If you try to insert formula text that contains newlines, Coda won’t properly process it as a formula.
@Paul_Danyliuk I’ve noticed that some of your column names starts with underscore, I guess it’s in order to differentiate them somehow but I wonder what exactly?
This is indication to myself not to use this column in user-facing sections (e.g., in views that are meant to be read-only or aren’t otherwise meant to be filled in by doc users). Only columns without underscores are safe to use outside of the “for builders’ eyes only” sections.
Maybe I didn’t do that so strictly with this very sample, but usually that’s the idea.
P.S. Also to mark columns that aren’t suitably formatted for user-facing output, and to hint that there’s another column without the underscore that should be used instead. So yeah, in the end it’s to prevent myself from showing columns that are not meant to be shown to users.
I see a similar parallel in Google Apps Script where the Google designers specifically implemented a way to help non-technical users avoid running functions that require arguments. By appending an underscore to the end of the function name, it is hidden from view in the run options and toolbar.
Thanks so much for this - it really will help me a lot but I just can’t get it to work (sorry, I have zero experience with coding so I am reaching out in the hope you can help)
As you can see from the screenshot below, the formula is failing to recognise that anything in the is a value/column