class HtmlService method .setTitle()

HtmlService is the Apps Script service.

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

What it does

Sets the title shown on a dialog or sidebar.

Why it's used

  • Give dialogs a clear title like Export settings.
  • Helps users know what modal they are looking at.

Common errors

  • Forgetting parentheses on setTitle. Write HtmlService.setTitle(), not HtmlService.setTitle or setTitle by itself.
  • Skipping dots between chained calls. Each step needs a dot, like HtmlService.setTitle().
  • Adding spaces where they do not belong. Write HtmlService.setTitle(), not HtmlService .setTitle(), HtmlService.setTitle (), or HtmlService . setTitle().
  • Wrong capitalization. Use HtmlService and setTitle, not htmlservice or settitle.

Explore

Related methods

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 HtmlService.setTitle().

Browse the blog