Queries when data source is Google Sheets

I am also exploring the Google Sheets data source and it is working great but I have a couple of questions that will probably be dumb issues but I am just beginning so bare with me.

My first question is: how do I query results from Google Sheets? What would be the similar to “where(‘Lorem’,’==’,‘ispum’)” from Firestore?

The other question is related with having different sheets within the same document. Is that related with the sheet index that I see in the configuration page?

Thank you!

Hi, Google sheet is not a database so there are no Queries available for the sheets. The sheet index refers to having multiple sheets in the document.

Ok! I already tried with the index values and saw what it is for. And I see about the limitations of taking the source of the data from a Google Sheet if there is no possibility to query. It can be useful for certain things though.

Thank you!

If your sheet is not hundreds of rows you could do the sorting and query in the List/Grid array script but it is somewhat a hacky solution.

Well, I was looking at having Google Sheet as data source for another project I have in mind related with the school I work in. The idea is to use Google Sheet so the data can be updated easily by more teachers and administrators. The data source would be all of the students of the school, which is around 550 students. It would be:

  • One single collection with all of them. In that case it would be necessary to query by two fields: level they are studying and the tutor they have assigned. Both of those values would be in different columns.

  • Different sheets listing the student in different levels. In this case it would only be necessary to query the tutor.

Could I get some example about the way to query with the script in the list/grid? I have been reading that there is a possibility to export data from Google Sheets directly to Firestore using Google App Script. I am going to give it a try.

Thank you!