How can I use a button to create a new section?

I haven’t checked Coda for an updated list of hidden formulas in a while, but there is one you can still use:

DuplicateSection([Section reference], "New name")

with two more optional parameters to control whether the tables and the data are copied as new tables or views of the original table. So you can have a template page and use this action to make copies of that page.

The action works, and it is also sufficiently documented, so I believe aside from the old name (sections are now called pages) it is rather stable. However, be advised that it is a hidden experimental undocumented formula and it may break or be removed at any point, and potentially break your doc. So only use if you assume all the risks and know what you’re doing.


In general, I advise to only create new pages when you actually need a different perspective into your data (e.g. a differently grouped table). If your intention with separate pages is to show different subsets of data (e.g. have a page per Project each showing a differently filtered view of the same Tasks table), consider using a single page with user-specific filters instead.

That is, unless you’re simply building a wiki with pages to fill out with text, not data. Then make pages to your heart’s desire.


Also, re original request. Even with the DuplicateSection() action, it doesn’t return a page reference or a link or anything that you could automatically put into a table of links. You’d still have to enter those links manually. You can use e.g. this trick to populate the table of page links more easily.

3 Likes