Formula to link to section

I have created an automation that duplicates a section at 9am every Monday, what I would like to do now is follow that up by generating a hyperlink to to the new section. Ideally I would like to include this in a slack message and add it to a table, but the part I’m stuck on right now is how to link to a section.

Does anyone know if this is possible?

I managed to create a link to a section using:
(thisDocument.Url() + '/' + Today().RegexReplace('/','-') + '-weekly-catch-up')
However the problem is that this uses Today() so the date in the section url is todays date not the date in the section title.

I don’t have this worked out all the way but my mind goes to stashing the URL in a table as part of the automation?

So you would have a table of links, and every Monday your automation would create a section and also add a row to that table, setting the URL column value to (thisDocument.Url() + '/' + Today().RegexReplace('/','-') + '-weekly-catch-up')

And then you could send a slack message with linksTable.URL.Last() to grab the most-recently generated URL

I gave that a try thanks, however it seems like the link is broken. Well… it has the correct URL, if I copy the generated URL and paste in the browser it works as expected. Seems like Coda doesn’t like the formatting of the URL.

Even if I simply add the full url Hyperlink("{{documentID}}/11-23-2020-Weekly-Catch-up") it link is broken.

I found the problem, in order for Coda to make the link it needs the Document ID and Section ID.

thisDocument.url() gives me the url with the Document ID{{ documentID }}, perfect. Now I need to target the section which I was doing by building the friendly url 11-23-2020-Weekly-Catch-Up. The generated URL works if pasted into the browser but Coda sees is as an invalid link, presumably because updating the page name would result in changing the friendly url but the section ID is constant, so it’s more reliable.

Testing with just the Document ID and SectionID{{documentID}}/subaL#_luZ6c worked perfectly. The trouble now is, how can I get the Section ID in my formula?

How are you creating the new sections?

I currently have a button set up with the following action:

DuplicatePage([\[Template\] Weekly Catch up], Today().join(' ','- Weekly Catch up'),duplicateOptions: 'DuplicateData')

I also have an automation setup to add the page to a 'Meeting Notes` table on Monday at 9am adding the following to the name column.

toText(Url(thisDocument) + "/11-23-2020-Weekly-Catch-up")

This adds the url but doesn’t seem to link it. I also then have a formula on column 5 that takes the URL and extracts the Section ID, RegexExtract(_Merge(thisRow.Name) + "", '(?<="url":").*?(?=")') This works if I manually add the url to the name section using @section-name but it doesn’t work when adding the url via the automation.

Meeting Notes Table:


Button Setup

Any ideas on what might be happening, I’m thinking I’m formatting the url incorrectly but nothing I’m trying seems to work.

I think you do need the sectionId or sectionURL but I don’t know of a way to access those via formula (strangely, as you can access thisDoc, thisTable, thisRow, etc). Maybe a Codan can shed some light? If it’s not currently possible, I second your feature request.


I don’t think it’s possible at the moment, it would be fantastic it as well as thisDocument.url() you could also get section id. Something like this thisDocument.sectionID('your section name').url()