class SpreadsheetApp method .prompt()

SpreadsheetApp is the Apps Script service.

.prompt() is the method name you will see after a dot in your code.

What it does

Shows a dialog that asks the user for text input.

Why it's used

  • Ask for a sheet name, email, or ID before the script continues.
  • Lightweight input without building a full HTML dialog.

Common errors

  • Forgetting parentheses on prompt. Write SpreadsheetApp.prompt(), not SpreadsheetApp.prompt or prompt by itself.
  • Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').prompt().
  • Adding spaces where they do not belong. Write SpreadsheetApp.prompt(), not SpreadsheetApp .prompt(), SpreadsheetApp.prompt (), or SpreadsheetApp . prompt().
  • Wrong capitalization. Use SpreadsheetApp and prompt, not spreadsheetapp or prompt.

Explore

Related methods

  • .alert()

    Shows a simple alert box with an OK button.

  • .showModelessDialog()

    Opens a dialog the user can use while still working in the sheet.

  • .showModalDialog()

    Opens a modal dialog that blocks interaction with the sheet.

  • .toast()

    Shows a short message in the bottom corner of the spreadsheet.

  • .activate()

    Makes a sheet or range the active selection.

Better Sheets tutorials

Add Columns Automatically

Add Columns Automatically

Create your own "Add Columns" button just like the add rows to the bottom.
Create a PR Agency From Scratch

Create a PR Agency From Scratch

Go from nothing to a working PR agency. Capture sites, and Send email vi...
Dylan Asks: How to Automatically Delete Rows If Cell Contains Value

Dylan Asks: How to Automatically Delete Rows If Cell Contains Value

Find out how to automatically delete rows based on a cell's value. We do...
Google Maps Scraper for Outreach

Google Maps Scraper for Outreach

Get this fun template to search on google maps via API, and quickly mess...
Google Sheets Stories? No! But we'll add timestamped video notes to your google sheets.

Google Sheets Stories? No! But we'll add timestamped video notes to your google sheets.

There was a stories craze. Every app/platform/business was adding 24 hou...
Password Protecting Data In a Google Sheet

Password Protecting Data In a Google Sheet

A funky way to password protect some data in a sheet, 3 ways to do it: w...
Password Protecting Data In a Google Sheet Part 2 The Basics

Password Protecting Data In a Google Sheet Part 2 The Basics

Covering some of the basics I skipped over in the part 1 video.
Scrape Google Maps

Scrape Google Maps

Scrape any query in Google Maps into your Google Sheets. Enter your API ...
Scrape Google Maps Added Phone and Reviews

Scrape Google Maps Added Phone and Reviews

Added two helper functions to get Phone numbers and reviews of the Googl...
Sheet Stories / Video Notes + Clear 24 Hour Old Videos

Sheet Stories / Video Notes + Clear 24 Hour Old Videos

Revolutionary Method to Manage Your Video Stories! Learn how to delete o...
Simple Inventory Management Automations

Simple Inventory Management Automations

Create a few simple automations like email notifications and low stock a...
Twitter App Clone in a Google Sheet

Twitter App Clone in a Google Sheet

I built a twitter clone in Google Sheets
Visicalc 2023 Design Walkthrough

Visicalc 2023 Design Walkthrough

Design walkthrough of VisiCalc 2023. Watch this if you'd like to see the...
Visicalc 2023 Quick Walkthrough

Visicalc 2023 Quick Walkthrough

This is a fun template I created for April 1st. Take a quick walk throug...

Related blog posts

Written guides about SpreadsheetApp.prompt().

Browse the blog