Google Sheets Integration

Google Sheets can be integrated straight into the Ninja Tables Pro, which is certainly one of its stunning features.

Moreover, the data in Ninja Tables will automatically update along with the data changes in Google Sheets. To be more specific, Google takes a minimum of 5 minutes to update the data on the web.

Data from Google Sheets to WordPress table #

To know how to implement this, follow this demonstration, where a Google Sheet data chart is used as an example.

Google Sheet
Google Sheet

  • We will import this data table to Ninja Tables. To do this, go to the Ninja Tables dashboard located in the sidebar. Then, go to the Add Table button from the top right corner of the dashboard.
Add Table
  • After that, a pop-up box will be visible. Choose Connect Google Sheets from the sidebar.
Connect Google Sheets
Connect Google Sheets
  • Then add a name to the table. It could be your Google Sheets name or any other name you want.

  • Go to the File option from the bar at the top and then Share → click Publish to the Web in your Google Sheet in order to get the Data URL.
Google Sheet data chart
Google Sheet data chart
  • Choose your predefined sheet in the Section Link. In this example, we are using Sheet 1. Also, select ‘Comma-Separated Values(CSV)‘ from the Embed Section, as Google shares its data to the web as CSV.
Publish to the web
Publish to the web
  • Make sure that in the Published content and settings option, the automatically republish when changes are made is checked.

  • Then copy the link, go back to the dashboard of your Ninja Tables and paste it into the Data Source URL. Once you’re done, proceed to the Next button.
Data Source URL
Data Source URL
  • Choose and save the entry fields you wish to add to. This is how all your data will be imported here automatically.
Select Entry Fields
Select Entry Fields
  • Now, go to your Google Sheet again, add some other data here, and check if the modified data is automatically applied to your Ninja Tables.

  • However, in this case, after you’re finished adding the details, you have to wait 5 minutes. This is because Google updates the table data cache every 5 minutes. Let’s push forward through the waiting period.

  • Go back to your Ninja Tables after 5 minutes, and reload the page. Then at the bottom of the table are the data rows you added 5 minutes ago.

  • This is it, the data will also be included in Ninja Tables if someone changes or adds some data to Google Sheets.

If your spreadsheet has hyperlinks or images, you can import them directly into Ninja Table so that the link will transform into a clickable link, and the actual image will appear.

Hyperlink: If you have any URL, by default Google will turn them into clickable links until you make them plain text by removing the link inside.

If you want Ninja Table to behave similarly, just change that column’s data type to HTML. It will transform all your hyperlinks into a clickable links.

Table Column
Table Column

Image: Just import your images into a cell using the Image in Cell option.

Insert Image in Cell
Insert Image in Cell
  • Now, as google blocks direct access to the images in Google Sheets, you need to change your share settings.

  • Click on the Share button from the top right corner of your sheet. Now in the next window, click on the Change to anyone with link text. That’s it! Now your image is accessible from Ninja Table.
Share link
Share Link

  • You must set that column’s data type into HTML in the final part. Now you should see your images inside Ninja Table.

Note that, as the data is shared to the web as CSV, which only contains text, so any formatting in the sheet will not reflect in the table. But you can do those formatting from the ninja table itself.

Moreover, if the Spreadsheet contains a column with Links in plain text and Image Links, using the Column Transform Value, it is quite possible to turn them into Clickable links and Actual Images. See the documentation to learn more about Column Transform Value.