Automatically import a Google Drive Sheet (CSV) into TablePress using Automatic Periodic Table Import

To keep this post short-and-sweet, which will be the aim for future articles, I am experimenting with the Situation, Task, Action, Result (STAR) method for this write-up. Do let me know if you think it works or not in the comments or the contact form.

Situation

A TablePress table listing sport fixture results (e.g. football, hockey etc.) requires regular updating.

This had been done by one person using an (offline) Excel spreadsheet and manually importing the .csv file. But the job has now been shared amongst a team of three (in different locations), so maintaining an offline spreadsheet no longer seemed practical.

Thus it made sense to create and maintain a single version on Google Sheets that could be edited by all.

But exporting and importing the file requires extra action. Could this process be automated?

Task

Automatically and periodically import a Google Sheet into TablePress to replace a table of fixture results

Action

  1. Download, install and enable the TablePress Automatic Periodic Table Import extension. Please note this is a premium plugin and so I would strongly encourage you to make a donation to Tobias Bäthge if you find it useful (the current recommended amount is $18).
  2. Login to Google Docs and open the sheet you wish to export.
  3. Click on File → Share → Anyone with the link can view to ensure the extension can access the sheet; simply enabling File → Publish to the web does not always work for the .csv format as this only makes the HTML output public, but not the .csv version.
  4. Copy the URL of the sheet, which should have the following format (where YOUR_DOCUMENT_KEY is the ID of your Google Sheet):

    https://docs.google.com/spreadsheets/d/YOUR_DOCUMENT_KEY/edit?usp=sharing

  5. Paste the URL into the Source field for the relevant table and replace:
    edit?usp=sharing

    with

    export?format=csv
  6. The final format is as follows:

    https://docs.google.com/spreadsheets/d/YOUR_DOCUMENT_KEY/export?format=csv

  7. Click the check-box to activate the Auto Import, set how frequently this should occur and save changes.

Result

A single online spreadsheet hosted on Google Docs/Sheets editable by multiple authors, which is then automatically and periodically imported into TablePress to replace a table of fixture results.

References

Posted in WordPress Tagged with: , , , , , ,
3 comments on “Automatically import a Google Drive Sheet (CSV) into TablePress using Automatic Periodic Table Import
  1. Steven says:

    Thanks! Works great. (and STAR method works as well )

  2. Flick says:

    @Steven: Many thanks for your comment. I am delighted to hear that the Google import tutorial was helpful to you (and that STAR works too! :D) If you have any suggestions for this article or ones you might like to see on this site in future, please do feel free to let me know.

  3. Chris Backe says:

    Not sure if it’s an issue with the plug-in or Google Docs, but it’s only possible to import the first sheet of a spreadsheet this way. Followed all the instructions and tried twice, but it only imported the first sheet…

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Subscribe