The old UserProperties and ScriptProperties services have been deprecated and replaced by the new PropertiesService. In the old service, a user property was available from all scripts to a particular user, and a script property was available to all users of a script.
In this new service, the getUserProperties() are available to a particular user running the current script, and getScriptProperties() are available to everyone running this script
At some point you’ll need to migrate your existing properties to this new PropertiesService. Here’s a handy script to do that
function mergeProperties (from, to, replace) { var props = from.getProperties(); var existingProps = to.getProperties(); Object.keys(props).forEach ( function (k) { if (replace || !existingProps.hasOwnProperty(k)) { existingProps[k] = props[k]; } }); to.setProperties(existingProps); return existingProps; }
function migrate() { mergeProperties ( ScriptProperties , PropertiesService.getScriptProperties()); mergeProperties ( UserProperties , PropertiesService.getUserProperties()); // check Logger.log("script"); Logger.log( PropertiesService.getScriptProperties().getProperties()); Logger.log("user"); Logger.log( PropertiesService.getUserProperties().getProperties()); }