🗣️📊 SwiftQuery AI now lets you ask questions with natural language, or easily drag + drop →

Querying Google Sheets with OpenAI

With the popularity of OpenAI’s Chat GPT, GPT3, and Codex a natural question for many is “how do I use this on my own data?”

Zing Data integrates OpenAI to let you use natural language to construct queries, rather than having to learn and use a specific query language.

For example, you might want to ask, “What are the sales figures for the past month?” or “Which products have seen the most growth in the past year?” and Zing Data, using OpenAI, will be able to understand and execute that query against your data.

In addition to using NLP to construct queries, OpenAI can also be used to understand the context and meaning of the data being queried. For instance - perhaps your columns are structured as SaleAmount, CustomerID, CustomerType, and City. You can simply ask “Sales by City and Type” and get back a correct result because an exact match is not required to figure out what fields your query is referring to.

One of the easiest and most common data sources is Google Sheet, CSV, or Excel file. We’ll walk you through how to use natural language to query your Google Sheets in less than two minutes:

  1. Create a (free) Zing Data account and login. We strongly suggest using the same Google account which has the sheet(s) you want to query.

  2. Tap ‘Set Up’ next to Google Sheets

  3. Click ‘Access your Google Sheets’ and give Zing the permissions requested. Alternatively, you can connect to a Google Sheet with a public URL.

    Make sure the ‘Live Connection’ option is turned OFF.

  4. Select the sheet you want to connect to and then click ‘Select

  5. Once the connection is confirmed, tap the ‘Zing App’ in the top right

  6. Tap on ‘Sources’ (left navigation) and then click on the data source you just added

  7. Type your natural language question in the search box at the top and then click the big ‘Text-to-Question (beta)’ button

  8. Your query will run and you’ll see a result (graph or data table) if your question could be recognized. If it couldn’t, go back and re-formulate your question.

    You can see the full SQL that was run and modify it if you’d like, save the question to access later, export a graph or CSV, or invite other people to your question.

Zing’s OpenAI-powered natural language querying works with other data sources as well, including Postgres, mySQL, Snowflake, Amazon Redshift, and Google BigQuery.

Natural language querying in Zing provides a more intuitive and powerful experience for querying and visualizing data than legacy BI tools like ThoughtSpot, Tableau, and PowerBI which require fields to be aliased to each variant a user might use for that field to make them useful in natural language querying.

Zing and OpenAI, however, benefit from a contextual understanding that SalesAmount can resolve to sales or amount or sales amount without a user needing to specify each of those aliases.

That means faster, more accurate answers with less data preparation work.

Related articles

Download Zing For Free

Available on iOS, Android, and the web

Learn how Zing can help you and your organization collaborate with data

Schedule Demo