Hi,
thanks for your post, and sorry for the trouble.
Yes, you will need to write a custom JSON format converted. TablePress can only import JSON arrays of arrays, i.e.
[["row 1, col 1","row 1, col 2","row 1, col 3","row 1, col 4"],["row 2, col 1","row 2, col 2","row 2, col 3","row 2, col 4"],["row 3, col 1","row 3, col 2","row 3, col 3","row 3, col 4"]]
but not other structures (from APIs etc.)
Regards,
Tobias
Thread Starter
cralox
(@cralox)
Hi there,
Thank you for your reply, so I am unable to use the tablepress plugin for what I would like to achieve or can I use tablepress with custom JSON format converted.
Sorry, just a little confused.
Hi,
if you develop some sort of intermediate interface that maps from your API’s JSON format to a table structure JSON format (like above), you can use TablePress to display that data.
Regards,
Tobias
Thread Starter
cralox
(@cralox)
Hi,
Ok, So would you suggest I could send the API to Google docs then pull the information from GD to tablepress, if this is doable will the site be slow?
Thanks again for your help.
Regards,
Craig
Hi Craig,
how often would you want to import from Google Docs? That’s the question. And of course the size of your table will play a role.
It might therefore be better to directly write e.g. a PHP script on your server that regularly fetches the data from your API and displays it.
Regards,
Tobias
Thread Starter
cralox
(@cralox)
Hi,
I would like to import at least once every 24 hour period, and there would be about 20-30 rows. I think its relatively small.
Your plugin is neat, an very easy to use, that why I have selected your plugin.
Could the PHP script be added to the plugin or will this need to be done separately.
Regards
Hi,
with a daily import of 30 rows you will not run into problems. The Google Docs solution could work then.
The PHP script would be separate. It would be the intermediate actor that TablePress would “call” for an import, and it would then retrieve and re-format the data from the API.
Regards,
Tobias
Thread Starter
cralox
(@cralox)
Hi,
Okay great. I will take a look at both options, thank you for your help.
I will let you know how I go.
Hi,
no problem! Always happy to help!
Best wishes,
Tobias