What is a Google Sheets Apps Script web app?
A web app turns your script into a URL that runs doGet or doPost when someone visits or posts data. The page can read and write your spreadsheet behind the scenes, which is useful for simple forms, internal tools, and lightweight APIs without standing up a separate server.
When to use it
Build a web app when you need a custom form, mobile-friendly view, or HTTP endpoint that reads sheet rows but should not expose the entire workbook to every visitor.
When to skip it
Skip a web app if Google Forms, an embedded chart, or sharing a filtered view is enough. Public web apps need careful auth choices so you do not leak private data.
How it works
-
1
Create an HTML file or return text or JSON from doGet(e) and doPost(e) in Code.gs.
-
2
Use google.script.run in HTML to call server functions that read or write the sheet.
-
3
Click Deploy > New deployment, choose type Web app, and set Execute as and Who has access.
-
4
Copy the deployment URL and test in an incognito window to match your audience permissions.
-
5
Version deployments when you change code so production URLs stay stable until you publish a new version.
-
6
Log errors with console and check Executions when users report blank pages or failed submits.
Examples in Google Sheets
Inventory lookup form
A web app shows a search box, calls a server function that QUERYs the Inventory tab, and returns quantity on hand without opening the master sheet.
JSON API for rows
doGet reads a named range and returns ContentService.createTextOutput(JSON.stringify(rows)) for a internal dashboard to consume.
Approval button page
Managers open a URL with a row id query param; doGet marks the row Approved and stamps the date in the sheet.
Better Sheets resources
Common mistakes
-
Deploying with Execute as Me and access Anyone while returning sensitive rows to anonymous users.
-
Forgetting to deploy a new version after code changes, then debugging old behavior for hours.
-
Putting secrets like API keys in client-side HTML where anyone can view source.
-
Using doPost without validating input, letting bad data overwrite production ranges.
-
Assuming web app users need edit access to the sheet; execution identity depends on deployment settings.
Frequently asked questions
- What is doGet vs doPost?
- doGet handles browser visits and link clicks. doPost handles form posts and many API clients sending data.
- Can a web app write to Google Sheets?
- Yes, when server functions use SpreadsheetApp and the deployment Execute as setting allows those writes.
- Do I need Google Cloud for a web app?
- Simple deployments work inside Apps Script. Advanced APIs or custom domains may need extra Cloud setup.
- Can I embed a web app in a site?
- Often yes with an iframe if your access settings allow the embedding context. Test cross-origin behavior.
- Why does my web app ask viewers to authorize?
- Execute as User accessing the app requires each visitor to grant scopes. Execute as Me can reduce prompts but runs under your account limits and responsibility.
- How do I update a live web app?
- Deploy > Manage deployments > Edit > New version, then save. Old URLs keep working on the version you select.
- Can web apps call external APIs?
- Yes with UrlFetchApp in server code, subject to authorization and allowlisting if your admin enforces it.
- Is a web app the same as Google Sites?
- No. A web app is a script URL you deploy. Google Sites is a separate website builder you can embed into.
Related Tutorials
Watch how Apps Script web apps works
10 Google Sheets I Wish Someone Would Make
Embed a Number in a Website from a Google Sheet
Curate Google Sheets Easily - Automatic Bookmarklet Maker
Calculate ROAS in Google Sheets
Set Up OnlySheets with Gumroad
Related blog posts
Guides that explain Apps Script web apps in more depth.
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →When did you learn the secrets of Google Sheets? | Sheet Talking Episode 8 Esa
Esa is a beginner at Google Sheets. I discover the moment he discovered the deepest secrets of Google Sheets. And we wax poetic about AI in sheets, and data flow.
Read post →Related terms
Google Sheets API
The Google Sheets API lets other programs read and update spreadsheets over HTTP using JSON. It is how dashboards, backends, and mobile apps sync data without opening the Google Sheets UI. Apps Script inside a file is simpler for sheet owners; the API fits systems built in Python, Node, or other stacks.
Read guide →Script Editor
The Script Editor is the Apps Script workspace inside your spreadsheet where you write JavaScript that talks to Sheets, Gmail, and other Google services. You open it from Extensions > Apps Script. Every function you save can be run manually, bound to a trigger, or linked from a custom menu.
Read guide →embed sheets
Embedding shows a spreadsheet, chart, or range inside a website, Notion page, or Google Site without sending visitors to the full Sheets UI. You usually publish to web or use an iframe with a link Google generates, combined with sharing permissions that match your audience.
Read guide →Google Sheets automation
Automation means work happens without repeating the same clicks every day: imports update, emails send, rows move, and dashboards refresh. In Sheets, automation usually stacks built-in features, Apps Script, and sometimes the Sheets API or add-ons. Start with the lightest tool that still solves the job.
Read guide →Done reading about Apps Script web apps?
Membership unlocks 600+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.
Need this once
Jump to a free tool or a single tutorial for this topic.
Learning Sheets for real
Unlock the full library, generators, and templates with membership.