Why you should explore Google Sheets and Data Studio before writing custom scripts.
There is a temptation, particularly now that AI can generate code in seconds, to solve every problem by writing a script.
Need a report? Write a script. Want to analyse some data? Write a script. Need a dashboard? Ask AI to generate a few hundred lines of JavaScript.
But what if the software you are using can already do most of the work?
Google Apps Script (sometimes informally called GScript) is an incredibly useful technology. It allows us to automate Google Workspace applications, connect services and create functionality that would otherwise be difficult or impossible.
However, it also introduces complexity, maintenance requirements and some surprisingly restrictive technical limitations.
Before writing a script, it is worth asking a simple question:
Have I actually exhausted what Google Sheets can already do?
Google Sheets Is More Powerful Than You Think
Many people still think of spreadsheets as collections of cells containing numbers and basic formulas.
Modern Google Sheets offers considerably more.
Alongside familiar functions such as SUM, COUNTIF and VLOOKUP, it supports powerful data processing tools including:
- FILTER – extract rows that meet specific conditions.
- SORT and UNIQUE – organise information and remove duplicates.
- ARRAYFORMULA – apply calculations across multiple rows.
- XLOOKUP – find information elsewhere in a dataset.
- IMPORTRANGE – bring data from another spreadsheet.
- LET and LAMBDA – build more sophisticated and reusable calculations.
- QUERY – use SQL-like commands to analyse data.
That final function deserves particular attention.
SQL-Like Queries Without a Database
SQL is the language commonly used to query databases, but Google Sheets includes a remarkably powerful QUERY function.
Imagine a school has a spreadsheet recording student participation in activities.
Column A contains the activity name, column B the year group and column C the number of participants.
We want a report showing total participation for each year group, excluding rows without a year group.
We could write:
=QUERY(A1:C1000,"SELECT B, SUM(C) WHERE B IS NOT NULL GROUP BY B ORDER BY SUM(C) DESC LABEL SUM(C) 'Participants'",1)
That single formula filters, groups, calculates and sorts the information.
No JavaScript. No additional permissions. No trigger configuration. No deployment.
Better still, the result updates as the underlying information changes.
There is an important distinction here. QUERY supports Google’s Visualization API Query Language, which resembles SQL but is not a complete SQL implementation. It does not, for example, provide all the capabilities of a relational database, including standard SQL joins.
Nevertheless, for everyday reporting and analysis, it can be extraordinarily useful.
Do You Even Need to Write a Formula?
Before exploring advanced functions, we should remember that Google Sheets already includes pivot tables, charts, conditional formatting, dropdown lists, data validation and other built-in features.
For many reporting tasks, a pivot table can produce the required summary in just a few clicks.
Named functions also allow users to package existing formulas into reusable functions without writing JavaScript.
These approaches are often easier for colleagues to understand, modify and maintain.
Sometimes the most sophisticated solution is the one that requires the least code.
Google Apps Script: The Powerful but Fussy Alternative
Google Apps Script is based on JavaScript and integrates directly with Google Workspace.
It can do things that spreadsheet formulas cannot.
You might use it to generate personalised documents, automatically send emails, create calendar events, process Google Form submissions or connect information between applications.
Those are compelling reasons to use it.
However, Apps Script is not simply JavaScript running on your own computer. It operates within Google’s managed environment, with its own permissions, restrictions, execution limits and service quotas.
This is where apparently straightforward projects can become frustrating.
1. Scripts Have Execution Limits
According to Google’s documentation, ordinary Apps Script executions are generally limited to six minutes.
Custom functions used directly inside spreadsheets have a much shorter execution limit of 30 seconds.
A small script may work perfectly with 100 rows of information and fail when the spreadsheet grows significantly.
A task that initially looks like a straightforward automation can therefore require batching, caching and additional error handling.
2. Performance Can Be Surprisingly Sensitive
One of the most common mistakes is reading and writing spreadsheet cells individually inside a loop.
Every interaction with the spreadsheet service has an overhead.
Google’s own performance guidance provides an example in which individually updating 10,000 cells takes approximately 70 seconds, while batching the operations reduces the task to around one second.
That is an enormous difference.
The underlying problem is not necessarily the JavaScript. It is how frequently the script communicates with Google services.
A script generated by AI might appear perfectly reasonable while using a highly inefficient approach.
This makes testing with realistic amounts of data particularly important.
3. Permissions Create Another Layer of Complexity
Apps Script may need permission to access spreadsheets, documents, email, calendars or other information.
These permissions are an important security feature, but they complicate deployment and sharing.
A script that works perfectly for its creator may require additional authorisation when someone else uses it.
Some scripts also behave differently depending on whether they are run manually, through a trigger or as a web application.
In a school, permissions are not simply a technical inconvenience. They are part of safeguarding and data protection.
We should be particularly cautious when scripts can access sensitive information, distribute documents or send messages on behalf of staff.
4. Triggers Do Not Always Behave as Expected
Apps Script supports triggers that run when a spreadsheet is edited, a form is submitted or a particular time is reached.
However, these triggers have restrictions.
For example, simple triggers cannot access services that require authorisation and are limited to 30 seconds.
Changes made through scripts do not normally activate an onEdit trigger.
Installable triggers offer more functionality, but they run using the account of the person who created them.
For shared projects, this creates questions about ownership, permissions and what happens when the original developer leaves the organisation.
5. Scripts Can Become a Maintenance Problem
A formula is usually visible inside the spreadsheet.
A pivot table can often be inspected by another member of staff.
A custom script, however, may contain hundreds of lines of code that nobody else understands.
What happens when a spreadsheet column is renamed? When a sheet is reorganised? When a third-party API changes? Or when the person who originally created the automation moves on?
Custom scripts create a maintenance responsibility.
This does not make them inherently bad, but it is a cost that should be considered before implementation.
Before You Write a Dashboard, Consider Data Studio
There is another tool worth exploring before building custom reporting systems.
Google Looker Studio, which was renamed Data Studio in April 2026, provides tools for creating interactive reports and dashboards.
It can connect directly to Google Sheets and other supported data sources, allowing users to explore information through charts, tables, filters and visualisations.
Consider a school that collects information through Google Forms.
The responses are automatically collected in Google Sheets.
A teacher or school leader wants to see participation by year group, trends over time and comparisons between different activities.
One approach would be to write Apps Script to process the information and generate reports.
But there may be a much simpler solution:
Google Forms -> Google Sheets -> Data Studio
The form collects the information. The spreadsheet stores and, where necessary, processes it. Data Studio presents it through an interactive dashboard.
No custom script is required for the reporting itself.
Data Studio also provides calculated fields, filtering and data blending capabilities, although these features have their own limitations.
It is important to recognise that Data Studio is primarily a reporting and visualisation tool. It is not a complete replacement for an application that needs to update records, perform complex workflows or send customised communications.
Nor is its data necessarily refreshed instantaneously. Connectors can cache information, and refresh behaviour depends on the source and configuration.
Nevertheless, it deserves serious consideration before somebody starts writing their own dashboard.
When Google Apps Script Really Is Worth Using
Having explored the limitations, it would be unfair to dismiss Apps Script.
It is genuinely powerful when you need to automate processes across Google Workspace.
Imagine a school wants to generate 200 personalised certificates.
Each certificate needs the student’s name, class, achievement and date, taken from a spreadsheet.
Apps Script could read the data, populate a Google Docs template, create PDF certificates and organise the resulting files.
That is a good use of scripting because it automates a repetitive process involving several different applications.
Another example might be automatically creating calendar events from an approved schedule or managing a complex workflow following a form submission.
The value comes from doing something that formulas and reporting tools cannot easily accomplish on their own.
Even then, the solution should be tested, documented and reviewed for security, reliability and long-term maintenance.
The AI Coding Trap
AI tools make this discussion particularly relevant.
A few years ago, writing custom Google Apps Script required at least some knowledge of JavaScript and Google’s APIs.
Today, somebody can describe their requirements to an AI assistant and receive a working script.
That is a tremendous opportunity.
But it also introduces a new temptation: creating software without checking whether software is actually needed.
AI can produce code that looks convincing but is inefficient, requests excessive permissions or fails when it encounters unexpected data.
More importantly, AI-generated code still needs an owner.
If the system stops working during a busy reporting period, somebody must understand what went wrong.
The real skill is not necessarily writing more code. It is choosing the most appropriate solution.
We should be asking AI tools questions such as:
- Can this be achieved using built-in Google Sheets functions?
- Would a pivot table or QUERY formula solve the problem?
- Could Data Studio produce the required report?
- Is there a genuine need to automate actions across different applications?
- What are the security, performance and maintenance implications?
These questions encourage better problem-solving rather than simply generating more software.
A Practical Decision-Making Framework
| What do you need? | Start with |
|---|---|
| Filter, sort or summarise data | Sheets formulas, QUERY or pivot tables |
| Reuse complex spreadsheet calculations | Named functions, LET or LAMBDA |
| Create charts and interactive reports | Google Sheets or Data Studio |
| Collect information and report on it | Google Forms, Sheets and Data Studio |
| Automate actions across Workspace applications | Google Apps Script |
| Build a complex multi-user system with substantial data | A purpose-built application or database |
Of course, these tools can also work together.
A well-designed system might use Google Sheets for collecting and preparing information, Data Studio for reporting and a small Apps Script for one specific automation.
The important point is that scripting should be a deliberate choice rather than the default.
Final Thoughts: Just Because You Can Code It Doesn’t Mean You Should
Google Apps Script is a valuable tool, particularly for educators and organisations already working within Google Workspace.
However, it comes with genuine limitations, and custom scripts can introduce unnecessary complexity into otherwise straightforward tasks.
Google Sheets deserves far more credit for the capabilities it already provides. Its QUERY function alone can replace a surprising amount of basic data-processing code.
Data Studio provides another powerful option for presenting and exploring information without building a reporting application from scratch.
As AI makes software development easier, we need to become more thoughtful about deciding when development is necessary.
The goal should never be to write as much code as possible. The goal should be to solve the problem as simply, safely and reliably as possible.
Sometimes that means writing a script.
Sometimes it means using a single spreadsheet formula.
And knowing the difference is an increasingly valuable digital skill.
Further Reading
- Google Sheets QUERY Function – Google’s documentation of SQL-like queries within spreadsheets.
- Google Visualization API Query Language – The language behind the QUERY function.
- Google Apps Script Best Practices – Official guidance on script performance and batching operations.
- Google Apps Script Quotas – Execution limits and service quotas.
- Google Apps Script Triggers – How automatic triggers work and their restrictions.
- Google Apps Script Authorisation – Permissions and security.
- Google Data Studio – Google’s reporting and dashboard platform.
- Google Cloud: Data Studio Returns – Google’s April 2026 announcement of the new branding.
