Solving “Script function not found: doGet”

You’ve written some Google Apps Script code and you are ready to Publish your web app. You click “Deploy as web app…” and navigated to the web app URL only to find…

Script function not found: doGet

This is a simple fix— don’t worry. The problem is that your Google App Script web app code is missing one critical thing: the doGet function.

 

The doGet Function

The doGet function, like the doPost function,  is what is called a “request handler.” It is the entry point for your web app.

Web apps work by receiving an HTTP GET (or POST) request and executing the code found within the request handler function. The problem is, if you don’t declare a request handler function, you can’t execute any code. That is why https://script.google.com/macros/your-app-path returns an error page that says “Script function not found: doGet.”

 

Common Problems

Web apps can be tricky when you are just starting but the errors generally come from the few typical sources.

The same problem can arise if you don’t you are sending a POST request but you don’t have a POST request handler. Then you will see the error, “Script function not found: doPost” error. 

If you see the error, “ The script completed but the returned value is not a supported return type.” That means you have handled the request but you have not returned the right type of safe and supported output. That means its time to read the following tutorial:

To learn everything about Google App Script web apps, check out this web app tutorial.

Leave a Reply

January 10, 2018

Posted In: Uncategorized

Leave a Comment