Builds HTML output from a string for dialogs or sidebars.
class HtmlService method .createHtmlOutput()
HtmlService is the Apps Script service.
.createHtmlOutput() is the method name you will see after a dot in your code.
What it does
Why it's used
- Build a sidebar or dialog from an HTML string.
- Prototype UI without a separate .html file.
Common errors
- Forgetting parentheses on createHtmlOutput. Write HtmlService.createHtmlOutput(), not HtmlService.createHtmlOutput or createHtmlOutput by itself.
- Skipping dots between chained calls. Each step needs a dot, like HtmlService.createHtmlOutput().
- Adding spaces where they do not belong. Write HtmlService.createHtmlOutput(), not HtmlService .createHtmlOutput(), HtmlService.createHtmlOutput (), or HtmlService . createHtmlOutput().
- Wrong capitalization. Use HtmlService and createHtmlOutput, not htmlservice or createhtmloutput.
1 Snippets using this method
Explore
Related methods
-
.createTemplate()
Creates an HTML template from a string with scriptlets.
-
.evaluate()
Renders a template into final HTML output.
-
.createHtmlOutputFromFile()
Loads HTML from a file in the script project.
-
.setTitle()
Sets the title shown on a dialog or sidebar.
-
.setHeight()
Sets the height of a dialog in pixels.
More Apps Script
1 Better Sheets tutorials
Add Click Tracking To Your Google Sheets | Bitly in a Google Sheet
Related blog posts
Written guides about HtmlService.createHtmlOutput().
How to Use Google Sheets as a Website Database
Did you know you can use Google Apps Script to turn a Google Sheet into a free, auto-syncing database for your website? This guide shows you exactly how to set it up. You’ll prepare your spreadsheet, write a few lines of code and publish your site. Don’t worry if you’re not a developer, we’ll walk you through it. Why Use Google Sheets as a Database? For small projects, Google Sheets offers many advantages over traditional databases: * Free hosting and storage * Easy to edit data without...
Read post →How to Send Google Forms Entries Automatically with Apps Script
Google Forms provides basic email notifications for form submissions, but enhancing these notifications with detailed summaries can significantly improve productivity and response management.
Read post →Explore Coding in Google Sheets
Did you know you can actually code in Google Sheets?
Read post →