I need to read a Google Sheet using the Sheets API. I can fetch all the rows, however since those rows are in tens of thousands and will continue to grow, I need to find a way to filter them without fetching all the rows.
I just need a SQL WHERE clause with an equality condition for one or more columns. For example, there's a phoneNumber column which is column C in the sheets. I just need to fetch the rows where this column has values equal to some value.
I am currently using the Google Sheets V4 API for Node.js. I was using the get api, but since it just has range
as the only filter option available, I thought of trying getByDataFilter api assuming it provides some way to filter the data.
Unfortunately, the only good way in getByDataFilter
API is to use GridRange in DataFilter. This still doesn't allow me to provide any condition to filter the data except using rows and/or column ranges.
So is there any way to do it without fetching all the rows? I can't modify that particular sheet. The only way I can find out now is to have a cron job run at midnight to sync the data with a database and then query the database.
Is there any better way to filter the data?