view results of google SQL query

Posted on 2016-10-18
Last Modified: 2016-10-19
With google sheet I can query any data sheet with one formula, eg:

=query(importRange(SourceDataKey, "regular!A:Z"),"SELECT * where upper(Col1)='F61' and upper(Col2)='IN'", true)

The output is an array of data.

I would like to be able to view this output automatically from a URL. I would generate a URL in google sheets and clicking it would show the results on a separate sheet.

myURL/... SourceData=.... Sheet=.... SQL= .....

Any suggestions welcome. I'm new to scripts but this might be an option too.

Question by:xenium
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9

Author Comment

ID: 41849030
From the developer documentation, this appears to be possible but I've only just seen this and not yet made it work:

Author Comment

ID: 41849041
Here's a working example URL that returns a query result:*%20where%20A%20%3C%2010

How can i have this display as a page? instead of downloading as a txt file which is in some kind of coded format

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users


Author Comment

ID: 41849195
Here is a URL giving an HTML view of a google spreadsheet, but without any query:

I'm looking to combine this with a query

Accepted Solution

xenium earned 0 total points
ID: 41849211

Author Comment

ID: 41849215
How can i specify a different sheet to query from. THe default appears to be the first sheet.

Author Comment

ID: 41849671
The following is a great overview, though the current URL syntax may have changed (see above for current examples)

To specify a sheet, set the GID (visible in the URL when viewing that sheet)

Author Comment

ID: 41850044
I will close this question shortly with a summary and hopefully a demo doc

Author Comment

ID: 41850160
Template with examples here:

Note this is editable so please only add constructive input.


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your app took Google’s lash recently, here are the 5 most likely reasons.
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
This Micro Tutorial demonstrates the importance of annotations in Google Analytics and how they should be used to document changes made to a site, Google updates (Ex: Panda & Penguin), marketing campaigns, and any other events that might have contri…
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question