Shows a simple alert box with an OK button.
class SpreadsheetApp method .alert()
SpreadsheetApp is the Apps Script service.
.alert() is the method name you will see after a dot in your code.
What it does
Why it's used
- Tell the user something went wrong in plain language.
- Confirm a count like updated 12 rows.
Common errors
- Forgetting parentheses on alert. Write SpreadsheetApp.alert(), not SpreadsheetApp.alert or alert by itself.
- Skipping dots between chained calls. Each step needs a dot, like SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Data').alert().
- Adding spaces where they do not belong. Write SpreadsheetApp.alert(), not SpreadsheetApp .alert(), SpreadsheetApp.alert (), or SpreadsheetApp . alert().
- Wrong capitalization. Use SpreadsheetApp and alert, not spreadsheetapp or alert.
Snippets using this method
- Visicalc 2023 Design Walkthrough
- Visicalc 2023 Quick Walkthrough
- Tweet From a Sheet
- Twitter App Clone in a Google Sheet
- Sheet Stories / Video Notes + Clear 24 Hour Old Videos
- Make a Tour of Your Sheet
- Google Maps Scraper for Outreach
- Get Every Editor on Every Google File I Own
- How To Download All Tabs as CSV in a Zip File
- Google Sheets Stories? No! But we'll add timestamped video notes to your google sheets.
- Curate Google Sheets Easily - Automatic Bookmarklet Maker
- Deep Inside Dark Habits Google Script
- Built a Cookie Clicker Clone in Google Sheets
- Different Kinds of Automation
- Add Columns Automatically
Explore
Related methods
-
.prompt()
Shows a dialog that asks the user for text input.
-
.toast()
Shows a short message in the bottom corner of the spreadsheet.
-
.showModalDialog()
Opens a modal dialog that blocks interaction with the sheet.
-
.showModelessDialog()
Opens a dialog the user can use while still working in the sheet.
-
.addItem()
Adds a menu item that runs a function when clicked.
More Apps Script
Better Sheets tutorials
Add Columns Automatically
Automate Emails
Built a Cookie Clicker Clone in Google Sheets
Creating A Dark Mode Theme | Announcing Dark Habits
Curate Google Sheets Easily - Automatic Bookmarklet Maker
Deep Inside Dark Habits Google Script
Get Every Editor on Every Google File I Own
Google Maps Scraper for Outreach
Google Sheets Stories? No! But we'll add timestamped video notes to your google sheets.
How To Download All Tabs as CSV in a Zip File
Make a Tour of Your Sheet
Tweet From a Sheet
Visicalc 2023 Design Walkthrough
Related blog posts
Written guides about SpreadsheetApp.alert().
Can I get alerted when a tab name is changed?
Use Apps Script to receive emails whenever there’s a change in your Google Sheet structure Are you an organization with multiple people working on the same Google Sheets file? Then, you might want to know when one of your people changes something in the spreadsheet, whether that be adding or deleting columns, changing the format, or adding tabs. In particular, one of our community members recently asked, “Can I get alerted when a tab name is changed?” To be honest, I didn’t know the answer...
Read post →What's Better Than Google Sheets?
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 →Google Sheets AI Formula
Does Google Sheets have an AI Formula? No but you can add one. Simple use Apps Script to add an AI formula to your sheets. You can use your own AI from Open AI and this comes out to be much cheaper than even $20 a month for ChatGPT at times. Depends on your use of AI. I just updated Better Sheets' AI apps script to use Open AI Omni. Get the full script here. Can I use ChatGPT in Google Sheets? No but you can create ChatGPT in Google Sheets. Let me show you! But I need help with Google...
Read post →