Share
Explore

TableExporter Pack Demo/Documentation

30860682ca81453d916c352eba758899.png

Export Coda tables to PDF, Markdown, HTML & CSV. No third party API involved.

PDF export works fine for wide tables as well ! If many columns, data written on multiple pages.

Note that it takes a while (up to a minute) for Coda API to retrieve updated data. So, if you make changes in the docs , you need to wait for sometime (might be a minute) to export latest/updated data.

VERY VERY IMPORTANT

If you copy this doc to try, don’t forget to update the formula’s with your doc id. If you just copy & try , it won’t work because it will still have my doc id. PLEASE REPORT ERRORS TO ME SO THAT I CAN HAVE A LOOK.


If you don’t know your doc id, just provide your document URL in this form here,

AUTHENTICATION

Requires a Coda API token, which can be automatically generated on behalf of each user.

DEMO TABLE

The following table will be used for demo. Fake data obtained from

Students
id
first_name
last_name
email
gender
ip_address
university
1
1
Ilaire
Ethington
Male
113.81.60.142
Metropolitan University’s
2
2
Keri’s
Habbon
Female
230.200.101.195
Monterey Institute of International Studies
3
3
Imogen
Mara
Female
3.44.104.96
University College Cork
4
4
Esme
Skep
Male
207.171.129.141
Tsinghua University
5
5
Brynn
Arman
Female
36.165.174.64
ITT Technical Institute West Covina
6
6
Ruthanne
Bergin
Female
134.167.213.27
Université d'Orléans
7
7
Nikos
Manlow
Male
67.112.170.106
Universität für Bodenkultur Wien
8
8
Wyatt
Dumini
Male
186.1.149.129
University of Redlands
9
9
Glad
Baton
Female
243.123.203.167
Shaheed Benazir Bhutto Women University
10
10
Micah
Gooke
Male
99.178.85.18
Hadhramout University of Science and Technology
11
11
Jori
Frowing
Female
254.143.180.180
Preston University
12
12
Toiboid
Clayhill
Male
23.128.134.126
Institute of Paper Science and Technology
13
13
Neysa
Reimers
Female
116.30.252.135
Soka University
14
14
Bibbye
Hucks
Female
214.74.230.49
Ecole Supérieure de Commerce de Lyon
15
15
Bonnee
Madre
Female
22.241.100.204
East China Normal University
There are no rows in this table


Formula’s

(1) PDF EXPORT : Export a table to PDF. Provide your own font & page size.

exportToPDF​(account, docId, tableId, output, linesOnly, pageSize, font​)
Export table to PDF

Only docId & tableId is required.

docId : Document Id of the Coda document
tableId : Table Id or Table Name of the desired table that you want to export.
output : file or base64 . By default it's file, so url will be returned. You need to use a button as action.
linesOnly : true or false. By default it's false. If true, horizontal lines will be used instead of grid.
pageSize : Choose a page size of the PDF. By default it's A4. You can choose various sizes like A0, A1, A2, Letter, etc. Autocomplete is provided.
font: Choose one of the 24 standard fonts. By default, it's helvetica font.

Parameters Added in version 2.2.0 (NEW)
landscapeMode: If true , page orientation will be landscape. By default, its false (portrait)
colsPerPage: Number of columns per page. Page width is equally divided by the total columns per page. By default, set to 5 in portrait mode & 7 if landscape/horizontal

Export Students To PDF
Click on the button!
Clicking on above button will export Students table to PDF. Below is the action used in the button. You don’t need to provide account, it will automatically be passed.
OpenWindow(exportToPDF([Rupjyoti Nath], "IEORyRB__5","Students" ) )
Here is a screenshot of the first page,
Screenshot_20220802_210930.png
Here is the second page,
Screenshot_20220802_211342.png
Here is an attached copy of the above export. Because the table is quite wide (TableExporter writes 5 columns max), two columns are in the next page. You need to provide your own name when saving file. In future, a default file name will be added automatically.
students_exported.pdf
7.4 kB
Don’t love grid, you can just pass linesOnly parameter as true to use horizontal line as separator!
Here is an attached PDF of the formula using linesOnly as true.
students_exported_linesOnly_true.pdf
7.8 kB
base64 output can be used if you need to send it as an email attachment.

(2) Markdown Export : Export a table to Markdown Table. You just need to copy/paste in actual markdown file.

exportToMarkdown​(account, docId, tableId, align, align_each​)
Export table to Markdown table

Only docId & tableId(or name) is required.

align: List of characters ('l','r' or 'c') for all columns separately. Will use alignment accordingly.
align_each: Just a character ('l','r' or 'c') , same alignment will be used for all columns.

The formula returns a markdown string for the table.
Here is the Markdown export of the Students table,
| id | first_name | last_name | email | gender | ip_address | university | | --- | --- | --- | --- | --- | --- | --- | | 1 | Ilaire | Ethington | iethington0@gov.uk | Male | 113.81.60.142 | Metropolitan University’s | | 2 | Keri’s | Habbon | khabbon1@nationalgeographic.com | Female | 230.200.101.195 | Monterey Institute of International Studies | | 3 | Imogen | Mara | imara2@examiner.com | Female | 3.44.104.96 | University College Cork | | 4 | Esme | Skep | eskep3@theatlantic.com | Male | 207.171.129.141 | Tsinghua University | | 5 | Brynn | Arman | barman4@wunderground.com | Female | 36.165.174.64 | ITT Technical Institute West Covina | | 6 | Ruthanne | Bergin | rbergin5@thetimes.co.uk | Female | 134.167.213.27 | Université d'Orléans | | 7 | Nikos | Manlow | nmanlow6@bizjournals.com | Male | 67.112.170.106 | Universität für Bodenkultur Wien | | 8 | Wyatt | Dumini | wdumini7@creativecommons.org | Male | 186.1.149.129 | University of Redlands | | 9 | Glad | Baton | gbaton8@indiatimes.com | Female | 243.123.203.167 | Shaheed Benazir Bhutto Women University | | 10 | Micah | Gooke | mgooke9@netvibes.com | Male | 99.178.85.18 | Hadhramout University of Science and Technology | | 11 | Jori | Frowing | jfrowinga@godaddy.com | Female | 254.143.180.180 | Preston University | | 12 | Toiboid | Clayhill | tclayhillb@dion.ne.jp | Male | 23.128.134.126 | Institute of Paper Science and Technology | | 13 | Neysa | Reimers | nreimersc@networkadvertising.org | Female | 116.30.252.135 | Soka University | | 14 | Bibbye | Hucks | bhucksd@surveymonkey.com | Female | 214.74.230.49 | Ecole Supérieure de Commerce de Lyon | | 15 | Bonnee | Madre | bmadree@unicef.org | Female | 22.241.100.204 | East China Normal University |
Here is the formula used,
exportToMarkdown([Rupjyoti Nath], "IEORyRB__5","Students" )

Copy Markdown Text
Click on the button!
Note: Markdown requires line breaks to be preserved. So, copy using “Copy to clipboard” button only, to preserve the new line characters.
Here is a screenshot of the table when viewed in ,
Screenshot_20220802_213203.png

(3) HTML EXPORT : Export a table to HTML Table. Only <table> part is generated. Provide your own colors.

You can use pack to generate full HTML code & send an email ! Or just use in a website.
exportToHTML​(account, docId, tableId, borderColor, backgroundColor, textColor, stripped​)
Export table to HTML

Only docId & tableId (or name) is required.

borderColor : Provide border colour of the table in hex.
backgroundColor : Provide a background colour in hex.
textColor : Provide a text colour in hex.
stripped : true or false. Default is true, so only even rows (1 based indexing including header) are background coloured. If you want entire table to have the background colour, you should pass false.
Here is the basic HTML export of the Students table with no custom styling,
<table style="font-family: arial, sans-serif; border-collapse: collapse; width: 100%;"><tr><th style="border: 1px solid #dddddd;text-align: left;padding: 8px;">id</th><th style="border: 1px solid #dddddd;text-align: left;padding: 8px;">first_name</th><th style="border: 1px solid #dddddd;text-align: left;padding: 8px;">last_name</th><th style="border: 1px solid #dddddd;text-align: left;padding: 8px;">email</th><th style="border: 1px solid #dddddd;text-align: left;padding: 8px;">gender</th><th style="border: 1px solid #dddddd;text-align: left;padding: 8px;">ip_address</th><th style="border: 1px solid #dddddd;text-align: left;padding: 8px;">university</th></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">1</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Ilaire</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Ethington</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">iethington0@gov.uk</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Male</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">113.81.60.142</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Metropolitan University’s</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">2</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Keri’s</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Habbon</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">khabbon1@nationalgeographic.com</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Female</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">230.200.101.195</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Monterey Institute of International Studies</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">3</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Imogen</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Mara</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">imara2@examiner.com</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Female</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">3.44.104.96</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">University College Cork</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">4</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Esme</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Skep</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">eskep3@theatlantic.com</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Male</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">207.171.129.141</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Tsinghua University</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">5</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Brynn</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Arman</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">barman4@wunderground.com</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Female</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">36.165.174.64</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">ITT Technical Institute West Covina</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">6</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Ruthanne</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Bergin</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">rbergin5@thetimes.co.uk</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Female</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">134.167.213.27</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Université d&#39;Orléans</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">7</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Nikos</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Manlow</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">nmanlow6@bizjournals.com</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Male</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">67.112.170.106</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Universität für Bodenkultur Wien</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">8</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Wyatt</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Dumini</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">wdumini7@creativecommons.org</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Male</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">186.1.149.129</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">University of Redlands</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">9</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Glad</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Baton</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">gbaton8@indiatimes.com</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Female</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">243.123.203.167</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Shaheed Benazir Bhutto Women University </td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">10</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Micah</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Gooke</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">mgooke9@netvibes.com</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Male</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">99.178.85.18</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Hadhramout University of Science and Technology </td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">11</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Jori</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Frowing</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">jfrowinga@godaddy.com</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Female</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">254.143.180.180</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Preston University</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">12</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Toiboid</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Clayhill</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">tclayhillb@dion.ne.jp</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Male</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">23.128.134.126</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Institute of Paper Science and Technology</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">13</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Neysa</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Reimers</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">nreimersc@networkadvertising.org</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Female</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">116.30.252.135</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Soka University</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">14</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Bibbye</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Hucks</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">bhucksd@surveymonkey.com</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Female</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">214.74.230.49</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;">Ecole Supérieure de Commerce de Lyon</td></tr><tr><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">15</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Bonnee</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Madre</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">bmadree@unicef.org</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">Female</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">22.241.100.204</td><td style="border: 1px solid #dddddd;text-align: left;padding: 8px;background-color: #dddddd;">East China Normal University</td></tr></table>

Here is the formula used,
exportToHTML([Rupjyoti Nath], "IEORyRB__5","Students" )
Copy HTML to Clipboard
Click on this button!
Here is a screenshot of the table when viewed in
Screenshot_20220802_214758.png

(4) CSV EXPORT


exportToCSV​(account, docId, tableId, output​)
Export table to CSV

Only docId & tableId(or name) required.

output: If 'string' , csv string will be returned instead of a downloadle url/ file export. Default is file/url.

Export Students to CSV
Click this button!
Here is the formula used in the above button as action,
OpenWindow(TableExporter::exportToCSV([Rupjyoti Nath], "IEORyRB__5","Students" ))
Here is a screenshot of the downloaded/exported CSV file,
Screenshot_20220802_215851.png

Here is the file for reference,
exported_students.csv
1.4 kB

If you want the CSV string, just pass output additional parameter as ‘string’.

NOTES

The pack currently used ‘simple’ return type when fetching data from Coda API.
Pack runs for a max time of 1 minute, large tables might fail to export.
Only visible rows & columns gets exported.

What’s Next

Release / Publish the pack [DONE]
More custom options on formula’s based on community suggestions.
UTF8 font/ custom font on PDF export.
Images & links in the exported PDF

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.