Sets the title shown on a dialog or sidebar.
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
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
-
.createHtmlOutput()
Builds HTML output from a string for dialogs or sidebars.
-
.setHeight()
Sets the height of a dialog in pixels.
-
.setWidth()
Sets the width of a dialog in pixels.
-
.createTemplate()
Creates an HTML template from a string with scriptlets.
-
.evaluate()
Renders a template into final HTML output.
More Apps Script
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().