New Page from Button -- Generate Link

Hey Coda Community,

I would like to create a new page from a template using a button in a table. The new page will be named with a value from the current row. I would like this action to also create a link to the new page in a field in the same row.

Any guess how to accomplish the link part/is it possible in the current iteration of Coda?

2 Likes

Hi @Chris_Herrmann,

I guess this is pretty similar to this requirement:

Unfortunately, there aren’t currently ways to get the generated URL of the new created page.

Ah, I would say it is similar indeed.

I’d take it there is no way to access the page structure formulaically then?

Formulaically no. Best you can do is either

  • Semi-automatically: manually insert a link to a page (using @) into a cell and formulaically extract a URL from that link:
    Extracting URL's from Hyperlinks - #4 by Paul_Danyliuk

  • Automatically but with a 3rd party tool: set up Integromat or Zapier to trigger on a webhook to get a list of pages via API and insert the link back into the table. In your DuplicatePage button you’ll have another action to OpenWindow() that webhook URL. You’ll still have to manually close that tab that opens. You also should probably have some delay, like 2-5 minutes, because there’s a delay between you copying the page and it actually being saved in the snapshot (I mean, if you query pages list through the API request right after duplicating the page, it may not see it yet for another few minutes)

1 Like

Thank you, Paul!

I am sure I am not alone in thinking this capacity would open up a world of opportunities in Coda. I wonder if this is on the roadmap anywhere.

I might play around with the Integromat solution but, more likely, I’ll just find a modification to my plan that fits within the existing constraints of Coda (thankfully, the Coda developers have been incredibly diligent in listening to user feedback to root out limitations and address them – thanks, Coda!).

3 Likes

To anyone finding this thread after Apr 2021 (because it got bumped for me), now DuplicatePage() actually returns a page URL that can be inserted into a cell, e.g.

thisRow.ModifyRows(
  PageLink, DuplicatePage(...)
)
4 Likes

Upvoting this in Oct 2021. I am attempting to create a projects table, where each new row creates a new subtasks table in a new (sub) page. This would be a much welcomed button/automation action or api method!

This is currently in beta testing.

1 Like

Thanks for the tip @Piet_Strydom!
I have since found the DuplicatePage() action also mentioned above, which is helpful too.
But the specific features you mention in this post sound perfect for me. Much appreciated!

1 Like

Update: the DuplicatePage() returning the page URL is useful!

However, it is still difficult to add dynamic filters to the duplicated page’s objects. (hopefully this is a beta feature!)

E.g. I cannot use a button to set a control in the duplicated page, because the button cannot identify a control that does not exist yet!

I thought I’d at least be able to reference the trigger row by using the duplicated table’s thisTable().Created value, but this also did not work because View of Table columns still reference the parent Table’s created date.

I made an example showing the tests here: Example · thisTable.Created() always returns Parent table's created() dateTime (no need to solve, just sharing an interesting insight!)

1 Like

Your example looks great!

1 Like