Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

130
Views
How to optimize queries to Spreadsheet via Google WebApp

I have a WebApp which sends vía google.script.run.withFailureHanlder(data).withSuccesHandler(data).someFunction(data) some attributes to filter a retrieve data from a spreadsheet in Drive. For example

Host side

google.script.run.withSuccesHandler(e => {
  console.log(e);
}).someFunction(data);

Google Apps Server Side:

function someFunction(data){
 let book = SpreadsheetApp.openByUrl(url).getSheetByName(data.name);
 let info = book.getDataRange().getDisplayValues().filter(x => {
   return new Date(data.start) > new Date(x[0]);
 });
 return result;
}

These spreadsheets are consulted by several people at the same time. At the beginning it was going well but now the data has grown a lot and the queries have become slow due to the amount of data.

Is there any way to optimize these queries without affecting the result of the other people when querying at the same time?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If the data in your spreadsheets does not change frequently, you can try caching the data on the client-side.

You can use IndexedDB as a cache to store the results of common queries in your clients' browsers, assuming their browsers support it. You'll also need to setup some code to periodically check the sheet for changes to update the cache/database on the client-side when necessary.

Dexie is a good IndexedDB wrapper, so I'd recommend using that library to get started.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!