Row lookup by ID
doGet reads e.parameter.id, finds the row on the Orders tab, and returns an HTML table of status and ship date.
doGet is a special function Apps Script calls when someone opens your web app URL with a browser GET request. It can return an HTML page from HtmlService, plain text, or JSON from ContentService. It is the front door for read-only views, lookup tools, and simple APIs backed by your sheet.
Use doGet when visitors need to load a page or fetch data with a link: status lookup by ID, embedded report, JSON feed of rows, or a form that loads before a doPost submit.
Skip doGet for actions that change data via a bookmarkable link alone; prefer POST with doPost or server functions with validation so accidental clicks do not write rows.
Define function doGet(e) in Code.gs. The parameter e carries query string parameters in e.parameter.
Build output with HtmlService.createHtmlOutputFromFile, ContentService.createTextOutput, or JSON.stringify for APIs.
Deploy with Deploy > New deployment, type Web app, and choose Execute as and Who has access.
Share the deployment URL. Each new version needs a new deployment or version update to go live.
Log e.parameter in test runs to confirm id and token query args arrive as expected.
Set MIME type explicitly for JSON and set headers if consumers expect application/json.
doGet reads e.parameter.id, finds the row on the Orders tab, and returns an HTML table of status and ship date.
doGet returns ContentService.createTextOutput(JSON.stringify(rows)).setMimeType(ContentService.MimeType.JSON) for a dashboard to consume.
doGet serves Form.html. The form submits via google.script.run or posts to doPost for the actual write.
Build this without starting from a blank cell
Use a Better Sheets tool for doGet, then watch a walkthrough when you want the full pattern.
Watch how doGet works
Guides that explain doGet in more depth.
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 →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 →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 →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.
Read guide →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 →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 →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 doGet?
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.