How can I populate data from Google Spreadsheet?
Visualizer lets you populate chart data directly from a Google Spreadsheet by publishing the sheet as a CSV and importing its URL, either as a full sheet or a selective subset using Google Query Language.
In this article
Import a whole spreadsheet
Go to your Google Drive and create a new spreadsheet document.

Enter your data:
- The first line of the spreadsheet must contain the series titles.
- The second line must contain the type of each series' data. You can use one of six data types:
string,number,boolean,date,datetime, andtimeofday. Enter these type names exactly as shown. Values such astime dateortime of daycause the import to fail. - The other lines contain data values that match the chosen data type.

Save the spreadsheet and click the File > Publish to the Web… menu item.

In the new dialog, click the Start publishing button. A link to the published item appears in the publishing dialog.

Under the Get a link to published data subheader, choose the CSV (comma-separated values) type and copy the link to the published spreadsheet from the text area below.

In Visualizer, create a new chart or edit an existing one and go to the Source step. Expand the Import data from URL section, then Import from CSV / XLSX. Enter the published link into the URL field, choose an import schedule from the dropdown (select One-time for a single import), and click Import. The data is uploaded automatically and the chart preview updates.
📝 Note: Importing data from a URL, including Google Spreadsheets, is a PRO feature. See the PRO version for details.

Use a subset of the spreadsheet
If your document has many columns but you only want to use some of the data, you can fetch a subset using the Google Query Language. In this example, the sheet has the following columns and you want to extract only columns A, C and E.

Click the File > Publish to the Web… menu item.

In the new dialog, click the Start publishing button. A link to the published item appears in the publishing dialog. Do not choose the CSV (comma-separated values) type.

Now that your spreadsheet is published, Visualizer can access it once you provide the link. To get the correct link for the next steps, click the Share button in the top right:

In the popup, click Copy link and save this link. It should look like this:
https://docs.google.com/spreadsheets/d/1IcBzqIbaKoKcOsfJ0aAQMdqNmQBqvaBKzOFuTntooZs/edit?usp=sharing
Using the Google Query Language, write the query that fetches the subset of data you need. In this example, the query is:
select A,C,EUse the encoder (found on that same page) to get the correctly encoded query, and copy it.

Put the encoded query into this string:
gviz/tq?tq=<QUERY>&tqx=out:csvIn this example, you get:
gviz/tq?tq=SELECT%20A%2CC%2CE&tqx=out:csvPut everything together to create the final link. Take the link from step 4: https://docs.google.com/spreadsheets/d/1IcBzqIbaKoKcOsfJ0aAQMdqNmQBqvaBKzOFuTntooZs/edit?usp=sharing
Then take the query string from step 7:
gviz/tq?tq=SELECT%20A%2CC%2CE&tqx=out:csvRemove the last part of the URL (edit?usp=sharing) and replace it with the query string. The result should look like this:
Enter this link in Visualizer to import its data, as described in the last step of the previous section.
Use cases
Dynamically display form data
Based on the data in the Google Spreadsheet, charts can be dynamically created and updated. With Visualizer, you can display information from a form that saves data in a Google Sheet and update it in real time. When you publish the Google Sheet in CSV format, as described above, Visualizer renders the URL source and the charts update live based on users' input.
