Toast in Google sheets using Google Apps Script

In this post, I will show you How to create a Toast in Google sheets using Google Apps Script.

What is Toast in Google Sheets

Toast is a popup window in the lower right corner of the sheets with the given message.

Google Apps Script

To create a toast dialog, edit or replace the greeting function as follows:

function greeting() {
  SpreadsheetApp.getActiveSpreadsheet()
   .toast("Hello World!", "Greeting");
}

Now if we click the button, then a toast dialog will appear in sheets as shown in the following screenshot, and it disappears within 5 seconds (the default):

Toast in Google sheets using Google Apps Script
function greeting() {
  SpreadsheetApp.getActiveSpreadsheet()
  .toast("My message to the end user.","Message Title",-1);
}