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. 1

    Create an HTML file or return text or JSON from doGet(e) and doPost(e) in Code.gs.

  2. 2

    Use google.script.run in HTML to call server functions that read or write the sheet.

  3. 3

    Click Deploy > New deployment, choose type Web app, and set Execute as and Who has access.

  4. 4

    Copy the deployment URL and test in an incognito window to match your audience permissions.

  5. 5

    Version deployments when you change code so production URLs stay stable until you publish a new version.

  6. 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.

Build this without starting from a blank cell

Use a Better Sheets tool for Apps Script web apps, then watch a walkthrough when you want the full pattern.

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

Browse more tutorials
10 Google Sheets I Wish Someone Would Make

10 Google Sheets I Wish Someone Would Make

if you're looking for ideas on what sheets to make I think this video is...
Embed a Number in a Website from a Google Sheet

Embed a Number in a Website from a Google Sheet

Ever wanted to display some data from a google sheet on your site? Witho...
Two Things to Know When Starting to Learn Google Sheets

Two Things to Know When Starting to Learn Google Sheets

Two things I would teach every beginner to immediately improve your skil...
Curate Google Sheets Easily - Automatic Bookmarklet Maker

Curate Google Sheets Easily - Automatic Bookmarklet Maker

Curated sites, articles, and more web resources super easily into a Goog...
Calculate ROAS in Google Sheets

Calculate ROAS in Google Sheets

Calculate Return on Ad Spend with a formula combination. Bonus: create a...
Set Up OnlySheets with Gumroad

Set Up OnlySheets with Gumroad

I'll guide you through the process of setting up Only Sheets with Gumroa...

Related blog posts

Guides that explain Apps Script web apps in more depth.

Browse the blog

Related glossary terms

Done reading about Apps Script web apps?

Membership unlocks 636+ 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.