Even though I don’t like embedding or iframes, sometimes you have to. As my Coda app is becoming the ‘single source of truth’ I have a need to publish a single table (or even a single record) on my website and I am not opposed to use an iframe if I have to.
The problem is that I haven’t found a way to embed a nice, clean page with just the information I need - there is the doc title, menu choices (left or top, even if it is a one page doc). the login stuff, a cookie warning… It makes it impossible to embed just a little bit of information.
I wouldn’t even mind using the API, but I am not sure how to implement the website part to make sure it shows and renews this table whenever it is updated in Coda.
My question is trifold:
- is there already a way to embed only a table or table elements from a published doc, or
- is Coda going to facilitate building pages for this type of purpose, or
- is there another way that I am overlooking to do this
Looking forward to some reactions,
Greetings, Joost
Edit (march 2023): with help from this community I have found a way to publish tables on my website. It takes a second or two to load, but it works and upon refreshing the webpage, the information get’s updated as well.
You use the Coda API to get a Coda table (or preferably a view of a (filtered) table) with a read only token to show Coda information on your page. It is a bit of work to setup, but with a bit of perseverance you can get it to work nicely. So now the website syncs with my Coda table.
You can still see this working on my homepage (site will renew later this year and then these messages might end up on another page). On the calendar page Coda is used to update the current schedule. We use a filtered table, so it only shows upcoming events, past days are filtered out.
6 Likes
following … thanks for sharing your methodology – our team wants to do basically the same thing!
Hi @joost_mineur do you have more detail on how you embedded the table, or links to the others in the community who helped you do so? Thanks
Yes, with the community help, i also managed to publish tables on my website using the Coda API, albeit with some loading delay. i can now filter the table to display only relevant information and demonstrates its functionality on his homepage and calendar page.
1 Like
Hello @Jonathan_Richardson,
Sorry for this late response - I didn’t see your message earlier.
Depending in the result you expect, it can get pretty complex in a hurry, but it is doable if you set it up one step at at time, publish your script and table to a test page on your website and check frequently so you know what you did wrong when the next step stops working.
As far a I know you can’t hide the javascript used to access your doc - so the token is visible for everyone. Since you are probably publishing to a public website I assume that is no problem - but do make sure you make a read only token for this purpose so nobody can corrupt your data.
In order to checkout the setup used, go to my webpage (either one mentioned in my earlier posting), right click (in Chrome) on one of the published tables (the text update is a simple script, the calendar is more complicated since it uses more columns, color coding and sorting) and inspect the source code. Everything you need is there - table data, the script with the API and javascript.
I plan on making a demo (some day…) with only the bare essentials on how to accomplish this, but you should be able to figuren it out by inspecting the source code. It’s not perfect, but it works.
When reloading a page an updated table is shown (it takes a couple of minutes before changes are reflected on your website, but for most applications that is not a big problem.
Greetings, Joost
What does your final embed code look like? (removing your specific variables fo API tokeen and table_ID, etc)
what on your website is a coda table?
You can check out the links in the top (first) post in this thread. You can find the embedded code when you inspect the source - I gave instructions how you can do that in my last post.
Thanks @joost_mineur so it sounds like we can copy and paste the Java script you mention and have a play around with it to work out how to do it ourselves?
That is correct - and a warning at the same time. You can’t hide your data once you publish it.