We have a lookup table with a bunch of rows of meeting agendas, and the main field being canvas (for the actual meeting agenda format). We then have a data table for the actual meetings.
One of those meetings, we have a button within the canvas field that will post a message to Slack, along with a link to that agenda. The get that link to work, I found ObjectLink() did not work (as it will refer to the template object instead of the actual data meeting). Which is fine - I made a field called âRow URLâ - in both the lookup and data table - and then just referenced ThisRow.[Row URL] instead.
Problem is: In the template table, the URL will appear fine. The content screen (under the Post to Slack button) shows the variables fine, they auto-format to the Coda âvariable bubbleâ, and it works.
However: When you then create a new row based on that template in the data table, you notice the Coda âvariable bubbleâ doesnât show up, just the raw formula is show, and the variables donât work. To make it work, you re-write the same formula (just when you write it manually, the variables convert to that bubble-looking visual design) and it works.
I am a bit stuck as I have tried a few ways to get this working, but every method relies on a variable being passed from template row to data row, and the variables are breaking down somewhere. Any tips?
For the record: I have tried formatting the URL in different ways, using format() or ToText() - but every time I create a new row, it is the weird translation of variables across template>data table that breaks down. Re-writing the same formula manually works, but that defeats the purpose of automation eh
Iâve encountered a similar issue before. I believe that Coda is using column IDs in formula internals (so that formulas donât break when we change column names). So, when we type the column name, it looks up the appropriate ID behind the scenes and associates it with that variable âbubbleâ. Then, when the formula is copied into a new row, rather than looking for a new column by the same name in the new context, it looks for the old column ID, canât find it, and gives up.
However, we can âtrickâ a Coda formula into doing a name-based column lookup. Itâs actually quite simple: remove/rename the âRow URLâ column from your template table, but leave in the formula reference of the literal form thisRow.[Row URL] (exactly how it appears after itâs copied into the data table). The template canvas will throw a fit and say that the formula contains an âUnknown Referenceâ, but now when the canvas containing the formula is copied into a data row, the Coda formula engine knows that it has an unresolved reference and will attempt a column lookup in the new row by name.
Iâve put together a minimal example doc demonstrating this behavior.
Edit: actually, Iâve tried having a column of the same name in both tables, and it still usually works for me. Truth be told, Iâve tried to break it again for 10 minutes now and canât get it to exhibit your original behavior. Looking at the column IDs between Template and Data tables, theyâre definitely not the same, so Iâm genuinely not sure why your original attempt isnât working.
You can right-click on the heading of a column, and select the âCopy Colum IDâ option to get the column ID field identifier. And then manually build a URL using that string.
Thanks! Not sure the syntax for referring directly to column IDs; and canât find anything in other community posts. thisRow.[c-##########] doesnât appear to work, and gives the error âcannot find column c-########## in thisRowâ.