Returns the unique ID of the current script project.
class ScriptApp method .getScriptId()
ScriptApp is the Apps Script service.
.getScriptId() is the method name you will see after a dot in your code.
What it does
Why it's used
- Build install links or support URLs for this project.
- Log which script version ran in an error report.
Common errors
- Forgetting parentheses on getScriptId. Write ScriptApp.getScriptId(), not ScriptApp.getScriptId or getScriptId by itself.
- Skipping dots between chained calls. Each step needs a dot, like ScriptApp.getScriptId().
- Adding spaces where they do not belong. Write ScriptApp.getScriptId(), not ScriptApp .getScriptId(), ScriptApp.getScriptId (), or ScriptApp . getScriptId().
- Wrong capitalization. Use ScriptApp and getScriptId, not scriptapp or getscriptid.
Explore
Related methods
-
.getAuthorizationInfo()
Returns what permissions the script has been granted.
-
.getProjectTriggers()
Returns all triggers set up in the script project.
-
.getOAuthToken()
Returns an OAuth token for calling Google APIs as the user.
-
.getService()
Returns a connected advanced Google service, like BigQuery or YouTube.
-
.invalidateAuth()
Clears stored authorization so the user must approve access again.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.
Related blog posts
Written guides about ScriptApp.getScriptId().
What's Better Than Google Sheets?
Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →How to reference a different Google Spreadsheet in Apps Script?
Transferring Data Between Cells in Different Spreadsheets
Read post →Business Idea: Script Writing Tips and Tricks in Google Sheets
Discover unique techniques, collaborations, and automated aids tailored for aspiring writers. Improve your scriptwriting skills with powerful Google Sheets tools.
Read post →