Error guides

Fix "ScriptProperties is not defined" (and UiApp, DocsList, ScriptDb…)

ReferenceError: ScriptProperties is not defined
TypeError: Utilities.jsonParse is not a function
ReferenceError: UiApp is not defined

Projects old enough to run on Rhino usually also call services Google has since shut down. Migrating to V8 is the moment to fix them.

Direct replacements

RemovedUse instead
ScriptProperties.getProperty(k)PropertiesService.getScriptProperties().getProperty(k)
UserProperties.setProperty(k, v)PropertiesService.getUserProperties().setProperty(k, v)
DocumentProperties.…PropertiesService.getDocumentProperties().…
Utilities.jsonParse(s) / jsonStringify(o)JSON.parse(s) / JSON.stringify(o)
Session.getTimeZone()Session.getScriptTimeZone()
Session.getUser()Session.getActiveUser() / Session.getEffectiveUser()
// Old
ScriptProperties.setProperty('lastRun', new Date().toISOString());
var cfg = Utilities.jsonParse(UserProperties.getProperty('cfg'));

// Current
PropertiesService.getScriptProperties().setProperty('lastRun', new Date().toISOString());
var cfg = JSON.parse(PropertiesService.getUserProperties().getProperty('cfg'));

Services that need a rewrite

How V8Shift handles it

Properties, Utilities.json* and the deprecated Session methods are rewritten automatically. UiApp, DocsList, ScriptDb, Xml, SoapService and Finance are flagged for manual work.

Have a whole project to migrate? Paste your .gs or upload a zip for a free V8 compatibility report — every occurrence of this pattern with file and line, plus an auto-rewritten project.
Related errors