CSV Links and Google Sheets Export

Stream results to Google Sheets


This feature is only available for cloud connections to Postgres, Redshift, BigQuery, Snowflake, Trino, Presto. We will be adding support to more connections soon!

You can stream results directly to Google Sheets after connecting PopSQL to your Google account. Check out how it works in this quick 1 minute demo video:

Using CSV Links with Google Sheets

You can use CSV links to import live query results into spreadsheet apps like Google Sheets. Using a query's CSV link, you can import your data into a spreadsheet and have it update automatically as new query results come in.

You can find the CSV link for your query in the share modal:

Note that we need to provide public access to your query results in order for Google to be able to fetch them on your behalf, so you must set your query permission to "Public" and check the "Include results" box. You may need to configure your account settings to allow public sharing if these options are not available.

In Google Sheets, you can now use the IMPORTDATA function with the CSV link to pull in our query results. Click into a cell and enter the formula:

= IMPORTDATA("<paste your CSV link here>")

Press enter and your query results should appear:

Google Sheets

You can now work with your query data inside of Google Sheets. Sheets will periodically refresh the results using the CSV link, so if we have a scheduled query set up in PopSQL this will ensure Sheets is always pulling in the latest results. You can even reference the values in any of the imported columns, and your formulas or conditional formatting will update automatically as new data is pulled in.

Refresh Rates

  • Google Sheets will update the data automatically at up to 1 hour intervals
  • To manually force Google Sheets to refresh the data, you can delete the cell with the IMPORTDATA function and press CMD/CTRL+Z or "undo".
  • PopSQL does not automatically run your queries unless you have a scheduled query configured. If you would like to get near "realtime" updates in Google Sheets, you would configure a schedule to run your query at least every hour to match the Google Sheets refresh frequency.

CSV Links and Query Variables

You cannot specify variables for the CSV link, but the results will take into account the variables that were used in the last run. The results shown will be the result of whichever variables were used in the last run.

Cookie settings