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

Returns the unique ID of the current script project.

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

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().

Browse the blog