Formula to add mentions in a string

I have:

  • a table that contains meta data about other tables (ref data)
  • pages that contain the ref data tables

In the table of meta data I want to put a formula that concatenates the table that has the reference data with a @, but the formula just generates a string and not a mention. What do I need to add to the string to get @TableName to show as a link to the table?

@Sean_Sloan can you put an example?


This is my table.

@Johg_Ananda I have a formula in the Data Samples column like this
If(thisRow.Modules.StartsWith("05"),Concatenate("@",thisRow.Title),"")

I was expecting that to have the same effect as me typing “@AVAILABLEOBJECTS” in that it would generate a link to the AVAILABLEOBJECTS that I have defined elsewhere, but it puts the literal string instead. I can’t find a function that changes this to a mention.

OK I understand now. When you concatenate()you are making a text string so Coda doesn’t think to create a link. What you want is a row reference.

I would use your string with a filter() formula or lookup() to filter a table to provide that row you are looking for.

There may also be a way to do it with the hidden _deref() formula but I am not proficient enough to tell you either way with that one.

Went off on a search on _deref and it turns out it is deprecated

In this case I am looking for a whole table not just a row - the link goes to a whole table of data, the table name being in the referenced column

I think I am trying to do something similar to this except I am looking at tables as I couldn’t figure out a way to do it with pages.

A few corrections.

When you Concatenate(), you aren’t making a text string, but a rich text that can contain links, @-refs etc.

_Deref() is marked as deprecated, but sometimes it’s the only way to work around code editor bugs. The editor becomes better though, so I find myself using deref less and less often. This here is not the case for it at all, though.

@Sean_Sloan:
Simply putting together a @ symbol and a piece of text won’t make it a reference. Besides, @-references can only reference rows or people — not tables. What you experience when you type @ and then get a list of stuff to insert, including tables — it’s just a shortcut to insert a link.

If you want to get a clickable link to a table, you have to do it like this:

Hyperlink(TableName.Url())

and then you can concatenate that wherever.

If you want to dynamically insert links to different tables — you cannot do that by table name because table URLs are based on table IDs (e.g. grid--U4OGUK-dE) or _suXXX#_tuYYY short page/view ID pairs, but not names. You’ll probably have to make a separate table that will link each name to a table URL:

image

(either enter those URLs yourself or do this to get them more easily)

Then instead of just entering table names, you’ll have to select items from this table and use the selected item’s URL in your Hyperlink()

1 Like

Thank you for the explanation. As the data is in relative terms static I just manually entered the links to the tables myself.