Apps Script: Script function not found
Last verified
Script function not found: doGetWhat it means
Apps Script was asked to run a function by name and no function with that name exists in the project. The name after the colon is what it looked for.
For web apps the name is doGet or doPost: Google's web app guide requires a script to define one of these to be deployed as a web app, and a GET to a deployment without doGet (or a POST without doPost) produces this message. For triggers, menus, buttons and drawings, the name is whatever was assigned to them; renaming or deleting that function leaves the trigger pointing at nothing.
Nothing is wrong with the function's body. The caller and the code simply disagree about a name.
What it looks like
function doGet(e) {
return ContentService.createTextOutput('ok');
}
function doPost(e) {
const data = JSON.parse(e.postData.contents);
return ContentService.createTextOutput(JSON.stringify({ received: true }))
.setMimeType(ContentService.MimeType.JSON);
}Why it happens
- A web app is being called with GET or POST but the project defines no doGet or doPost.
- A trigger, custom menu item or image button is assigned to a function that was renamed or deleted.
- The web app deployment points to an old version that did not contain the function.
- A typo or case difference in the assigned name (Apps Script function names are case sensitive).
- The function was defined inside another function or as a non-global, so it is not visible by name.
How to fix it
- Read the function name in the message and search the project for an exact, case-sensitive match.
- For web apps, add the missing doGet(e) or doPost(e), then use Deploy > Manage deployments to publish a new version; editing code alone does not update an existing versioned deployment.
- For triggers, open the Triggers page and edit or recreate the trigger to point at an existing function.
- For buttons and drawings, right-click the image, choose Assign script, and enter the current name without parentheses.
- Make sure the function is declared at the top level of a .gs file.
How to stop it recurring
Treat function names used by triggers, menus and deployments as a public interface: do not rename them casually, and keep a comment listing what calls each one. After changing a web app, always create a new deployment version and test the deployed URL, not just the editor.
Official documentation: developers.google.com/apps-script/guides/web. See all Apps Script error messages or the Apps Script limits and quotas.
Related errors
Definitions
- Google Apps ScriptGoogle Apps Script is Google's cloud-hosted JavaScript platform for automating Google Workspace: Sheets, Gmail
- Error HandlingError handling is the practice of anticipating, detecting, and responding to errors in software execution, inc
- Rate LimitingRate limiting is a technique that controls the number of requests a client can make to a server within a given
- OAuth 2.0OAuth 2.0 is the IETF authorization standard (RFC 6749) that lets an app access your account in another servic
Quick answers
What does "Script function not found" mean in Apps Script?
Apps Script was asked to run a function by name and no function with that name exists in the project. The name after the colon is what it looked for. For web apps the name is doGet or doPost : Google's web app guide requires a script to define one of these to be deployed as a web app, and a GET to a deployment without doGet (or a POST without doPost ) produces this message.
How do I fix "Script function not found"?
1. Read the function name in the message and search the project for an exact, case-sensitive match. 2. For web apps, add the missing doGet(e) or doPost(e), then use Deploy > Manage deployments to publish a new version; editing code alone does not update an existing versioned deployment. 3. For triggers, open the Triggers page and edit or recreate the trigger to point at an existing function. 4. For buttons and drawings, right-click the image, choose Assign script, and enter the current name without parentheses. 5. Make sure the function is declared at the top level of a .gs file.
Run the job somewhere with its own limits
If a script keeps hitting its host's quotas, an Autonoly workflow can run the same steps on a schedule in an isolated cloud container, and the AI agent has a terminal with Python for steps that need code. Autonoly has limits of its own, priced in credits.
Also see Agent terminal & SSH.