Variables don't work when copied off of templates

Hey team,

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 :slight_smile:

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.

Hey! Tried to replicate this, was especially hopeful about a type of “forced” lookup - but sadly, same issue persists.

Is there a way to find the unique field identifier? So I can directly reference it?

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.

Hmm - that option doesn’t show up for me. Could you take a screenshot as an example please?

Dear @Erica_Anderson,

It’s the last instance, as you can see in the screenshot.
Please note that the page should be un-locked to get this visible.

Interesting! I don’t have that option:

Also tested a few different tables to see, and that option doesn’t appear.

if you need Table id, col id, …
go active developper mode in setting → all down → LABS

1 Like

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”.

Dear @Erica_Anderson,

Could you share an anonymized copy of the doc, so we can actually see what happens and enhance the chances to find a solution.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.