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
  • 9

Author Comment

ID: 41849018

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


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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline


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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
.csv files 5 79
Ready Made PHP Scripts 5 54
Sed question 2 49
onOpen 14 43
I'm Dumb-phoned(ed) Last week, I noticed this message when adding events to my Google Calendar: On June 27th (2015), Google is removing SMS as a notification option for Google Calendar events.  Their assumption is that enough people have smart p…
The choice of selecting a perfect productive suite for one’s organization is a critical decision that an IT Manager or a CIO has to make. And when it comes to choosing a cloud-based productivity suite, the choice gets all the more difficult. This is…
This Micro Tutorial demonstrates how to quickly find related content for YourTango's posts using MozBar Chrome extension.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

744 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now