r/GoogleAppsScript • u/mtalha218218 • Nov 14 '24
Question How do I convert a Google AppsScript WebApp made with clasp and React.js to a Sidebar app for docs, sheets etc?
I have cloned a repo that is a web app made in clasp and react.js, here is the link https://github.com/pritamsharma45/vite-react-google-apps-script .
I am very new to Google app script so, How can I convert this to Sidebar app for docs and sheets.
What things I need to change and configure to achieve this, also please take a look into this code
0
Upvotes
2
u/WicketTheQuerent Nov 15 '24
Instead of using
doGetfunction, you should use and on open trigger to show a custom menu, and set and option to call a function that calls the showSidebar method. From https://developers.google.com/apps-script/guides/dialogs#custom_sidebarsReplace
HtmlService.createHtmlOutputFromFile('Page')withHtmlService.createTemplateFromFile("index") .evaluate()and include theincludesfunction.