Webhook intake
doPost parses JSON from a CRM webhook and appends name, email, and source columns to a Leads sheet.
doPost is the Apps Script handler for HTTP POST requests to your web app URL. External forms, Zapier, or custom clients send data in the request body, and doPost parses it and writes to your spreadsheet. Pair it with doGet when you need both a landing page and a submit endpoint.
Use doPost when data arrives from a submit action: web form POST, webhook from another tool, mobile app callback, or API client adding rows without opening the sheet.
Skip doPost for read-only lookups; use doGet instead. Do not expose an open POST endpoint without validation if Anyone can access the deployment.
Define function doPost(e) in Code.gs. Read the body with e.postData.contents and e.postData.type.
Parse JSON with JSON.parse when clients send application/json.
Validate required fields, sanitize values, and append or update rows with SpreadsheetApp.
Deploy as a web app and give POST clients the same deployment URL used for GET.
Return a text or JSON response so callers know success or failure.
Log failures to a Debug tab or Executions for support when integrations break.
doPost parses JSON from a CRM webhook and appends name, email, and source columns to a Leads sheet.
A public form posts application/x-www-form-urlencoded data. doPost maps e.parameter fields to columns and returns Thank you text.
Authenticated POST with a shared token in the header appends a row only when the token matches Script Properties.
Build this without starting from a blank cell
Use a Better Sheets tool for doPost, then watch a walkthrough when you want the full pattern.
Watch how doPost works
Guides that explain doPost 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 →Did you know you can actually code in Google Sheets?
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 →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 →A workflow is the path work takes through your sheet: intake, review, approval, done. Good workflows use consistent columns, statuses everyone understands, and just enough automation to move tasks forward without hiding steps from the team.
Read guide →Done reading about doPost?
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.