In this post, I will tell you how to create a sidebar in Google Sheets with Google Apps Script.
The sidebar is an operation panel displayed on the right side of the screen that can be used for G Suite applications.
In other words, it is a kind of user interface.
official documentation of sidebar
The sidebar can be created for the following applications:
Creating the Html file and code editor will look like this
Write Below code in code.gs
function onOpen() {
SpreadsheetApp.getUi()
.createMenu('Sidebar')
.addItem('createSidebar', 'createSidebar')
.addToUi();
}
function showSidebar() {
var htmlOutput = HtmlService.createHtmlOutputFromFile('Sidebar');
DocumentApp.getUi().showSidebar(htmlOutput);
}
write below code in Sidebar.htm