I am trying to run a webapp from a spreadsheet when the user clicks a menu item. The code is below. My problem is I get this error message
We're sorry, a server error occurred. Please wait a bit and try again
I have deployed it as a webapp and when I do the test deployment all is good but if I try and run it from the spreadsheet I get the above. What am I doing wrong?
function onOpen() { var ss = SpreadsheetApp.getActive(); var menuEntries = [{name: "xxx", functionName: "doGet"}]; ss.addMenu("yyy", menuEntries); } function doGet() { var ss = SpreadsheetApp.getActive(); let HTMLString = "<style> h1,p {font-family: 'Helvitica', 'Arial'}</style>" + "<h1>Hello World!</h1>" + "<p>Welcome to the Web App"; HTMLOutput = HtmlService.createHtmlOutput(HTMLString); return HTMLOutput };