class SpreadsheetApp method .showSidebar()

SpreadsheetApp is the Apps Script service.

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

What it does

Opens a custom sidebar built with HtmlService.

Why it's used

  • Give users a control panel with buttons and filters beside the sheet.
  • Better Sheets-style tools often live in a sidebar instead of menus alone.

Common errors

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

Explore

Related methods

  • .createMenu()

    Builds a custom menu in the spreadsheet toolbar.

  • .addToUi()

    Publishes a custom menu to the spreadsheet UI.

  • .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.

  • .getUi()

    Returns the UI object used to build menus and show dialogs in Sheets.

Better Sheets tutorials

No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.

Related blog posts

Written guides about SpreadsheetApp.showSidebar().

Browse the blog