Author: By Raj

Part of our Apps Script Web Apps guides. Need this built for your team? Hire a Google Apps Script developer.

Estimated reading time: 10 minutes

Build Your First Google Apps Script Web App: Step-by-Step Guide

Your first Apps Script web app exposes doGet to the browser and optionally doPost for forms. Deploy via Deploy > New deployment > Web app, choosing execute-as and who-has-access settings deliberately.

A minimal app returns HtmlService HTML; advanced apps use google.script.run to read and write Sheets without exposing the spreadsheet URL structure.

Follow with /blog/apps-script-html-service-guide for UI polish and /blog/apps-script-user-authentication for domain restrictions.

Hello World doGet

function doGet() { return HtmlService.createHtmlOutput('<h1>Hello</h1>'); } Deploy and authorize scopes when prompted.

Copy the /exec URL, versioned deployments keep old URLs stable when you create new deployment versions.

Sheets-backed data

Server function listRows() returns getValues() arrays to the client via google.script.run.withSuccessHandler. Never put service account keys in client JS.

Validate inputs server-side even if client validates too.

Deployment checklist

Execute as: Me vs User accessing web app affects whose quotas and Sheet access apply. Internal tools often use User accessing for audit trails.

Who has access: Only myself for testing, Anyone within domain for intranet, Anyone for public forms, choose minimum necessary.

Iterate safely

Use Test deployments for QA. Document deployment ID in README. When changing doPost schema, version API with ?v=2 query param.

Monitor Executions for uncaught exceptions users trigger via UI.

Example code

function doGet(e) {
  const tpl = HtmlService.createTemplateFromFile('Index');
  tpl.params = e && e.parameter ? e.parameter : {};
  return tpl.evaluate().setTitle('Ops Portal').setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);
}
function include(filename) {
  return HtmlService.createHtmlOutputFromFile(filename).getContent();
}
ApproachBest forTradeoff
Apps Script nativeGoogle Workspace-centric workflows6-min limit, quotas
Zapier / MakeNo-code, many connectorsPer-task cost, vendor lock-in
Python + CloudHeavy data / MLHosting cost, separate auth
Apps Script web app developmentProduction custom logicBuild cost, you own code

FAQ

Why does my web app ask for authorization again?

New scopes or Execute-as change requires re-approval. Users may see consent screens, document why.

Can I use custom domain?

Web apps live on script.google.com URLs. Front with reverse proxy only if your security team approves.

How do I pass query params?

Access e.parameter.orderId in doGet. Validate and sanitize before database lookups.

Difference /dev and /exec?

/dev always latest code for editors; /exec is versioned deployment for production users.

Next steps after hello world?

Build CRUD patterns in /blog/apps-script-crud-app-sheets and secure with /blog/apps-script-user-authentication.

Need this done for you? I handle this as part of my consulting work, fixed-price quote within 24 hours.

Book a call with Raj →

Get the full Build Your First Google Apps Script Web App script template

I'll email you a production-ready, commented version you can deploy in 10 minutes.

Need help with this? I handle this as part of my Apps Script Web Apps service.

Internal tools, CRUD apps, HtmlService UIs, and Google SSO.

See how it works →