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.
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?
Automatically and periodically import a Google Sheet into TablePress to replace a table of fixture results
- 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).
- Login to Google Docs and open the sheet you wish to export.
- 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.
- Copy the URL of the sheet, which should have the following format (where YOUR_DOCUMENT_KEY is the primary ID of your Google Sheet):
- Paste the URL into the Source field for the relevant table and replace:
- The final format is as follows:
UPDATE with props to Alessandro: The above will import the first sheet (‘Sheet1’) or gid=0 so if you are looking to import a specific tab/sheet in a multi-sheet document, you will need to identify the GID=YOUR_GID_KEY reference and include it in the url.
The final format of a specific sheet is as follows:
- Click the check-box to activate the Auto Import, set how frequently this should occur and save changes.
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.
- WordPress.org TablePress Support – Auto-Import Google Drive Spreadsheet
- WordPress.org TablePress Support – Automatic Periodic Table Import + Google Sheets
- New Google Spreadsheets publish limitation comment by s4tori
- CSV Auto Fetch using Google Drive Spreadsheet – Step 2
- New Google Spreadsheets publish limitation comment by brilletju