Button to Create new Table from Template?

Currently I have a button on a document which gets data from a Pack formula and adds rows to an existing table.

I would like to revise this to a button that creates a new table based on a template for its columns, then adds the rows to that new table.

Is it possible to do this?

1 Like

I don’t think so. Neither the API, SDK, or Formula Language has a way to add a new table to a document.

1 Like

Have you tried putting the table on a page, as you can duplicate a page?

But a question- why so many tables?

P

I tried that. If I create an automation to duplicate a page, the next step would then be to add rows to the table on the new page. I do not know how I would be able to specify the name of the new table in a programmatic way; it would have a number on the end that is automatically incremented; how do I write the automation to address the just-created table on the just-created page?

The app allows the user to search for information on various topics contained in the API.

I would prefer individual tables because for users working ad lib doing research that is simpler than creating/remembering a tagging scheme. And because if everything is in one table then the table can grow large enough so performance slows.

I suppose the follow-up to your question is to suggest I implement buttons to add tags/keywords and buttons to move/copy between tables if desired. That is probably what I will do; honestly Coda is so advanced in many ways (truly an amazing app) I am a bit surprised that really simple stuff like copy/moving records between tables and programmatically adding a table are not built-in capabilities.

Correction @Piet_Strydom

I think duplicating a page will work indeed.

If I set up a hidden page as a template with a table and also a button to add records to that table, then duplicating the page not only creates a new table but also adjusts the button automation on the new page to match the new table.

So it achieves the desired result

Thanks

1 Like

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