Google App Script: How to resolve error Script function not found: doGet in Google App Script

As per my previous post related to 'How to create a simple Hello World standalone HTML/Javascript page with Example in Google App Script'. I have explained about Code.gs file in Step 4. When you created the new project first time the Code.gs file by default created in editor in which we need to create a method function doGet(e). 

See example below:

function doGet(e) {
  return HtmlService
    .createHtmlOutputFromFile('helloworld.html')//This is html file we want to render
    .setTitle("Hello World Example");//We can set title from here
}

We need to add doGet(e) function in Code.gs to publish project as WebApp. This function uses HTMLService to return HTML Output of helloworld.html file that we created earlier post 'How to create a simple Hello World standalone HTML/Javascript page with Example in Google App Script'.

If you missed to add this function doGet(e) in Code.gs file then it generally throws this error message "Script function not found: doGet".

For more detail please refer google developers doc: https://developers.google.com/apps-script/guides/web


I hope, it must be helpful & please share your feedback or queries in comments box.
Google App Script: How to resolve error Script function not found: doGet in Google App Script Google App Script: How to resolve error Script function not found: doGet in Google App Script Reviewed by Pranay Gondane on 7:27:00 AM Rating: 5

No comments

Free! Free!Free! Subscribe to Get Free PHP (Magento) tutorial Update in Your Inbox!!! Hurry Up!!!