Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making two querys at the same sheet #118

Open
benjaroa opened this issue Feb 9, 2017 · 2 comments
Open

Making two querys at the same sheet #118

benjaroa opened this issue Feb 9, 2017 · 2 comments

Comments

@benjaroa
Copy link

benjaroa commented Feb 9, 2017

Is there a way to retrieve data from two different sheets of a single document?

Regards!

@chriszarate
Copy link
Owner

The sheet ID is encoded in the URL (in the gid query variable). Just grab the URL of the sheet you want to query and pass to Sheetrock.

If you mean "query across two sheets at the same time," then unfortunately the answer is that Google's API does no support this. You could either combine the sheets (possibly with a reference) or use a solution like Alasql combined with Sheetrock's callback option (as you posted in the other issue).

@benjaroa
Copy link
Author

Hi Chris,

Thanks!
I'm working with several drive documents (five, but will be more!), each one has one sheet with the "model" in SQL (eg. create table people...) and the second one, the data of that model (eg. people info).

So, I created a function that loop over the sheets on each document, creating the data model, and then inserting the data on each table. Using Sheetrock to read and AlaSQL to manage the client-side data.

I was wondering if this read-and-dump function could be improved calling each drive document one single time and reading the two resourses I need (model and data). So: two queries, one connection.

Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants