Stay organized with collections Save and categorize content based on your preferences.
ScriptPropertiesDeprecated. This class is deprecated and should not be used in new scripts.
Script Properties are key-value pairs stored by a script in a persistent store. Script Properties are scoped per script, regardless of which user runs the script.
Deprecated methodsdeleteAllProperties()
Deprecated. This function is deprecated and should not be used in new scripts.
Deletes all properties.
ScriptProperties.deleteAllProperties();Return
ScriptProperties
— this object, for chaining
deleteProperty(key)
Deprecated. This function is deprecated and should not be used in new scripts.
Deletes the property with the given key.
ScriptProperties.deleteProperty('special');Parameters Name Type Description
key
String
key for property to delete Return
ScriptProperties
— this object, for chaining
getKeys()
Deprecated. This function is deprecated and should not be used in new scripts.
Get all of the available keys.
ReturnString[]
getProperties()
Deprecated. This function is deprecated and should not be used in new scripts.
Get all of the available properties at once.
This gives a copy, not a live view, so changing the properties on the returned object won't update them in storage and vice versa.
ScriptProperties.setProperties({ "cow" : "moo", "sheep" : "baa", "chicken" : "cluck" }); // Logs "A cow goes: moo" Logger.log("A cow goes: %s", ScriptProperties.getProperty("cow")); // This makes a copy. Any changes that happen here will not // be written back to properties. var animalSounds = ScriptProperties.getProperties(); // Logs: // A chicken goes cluck! // A cow goes moo! // A sheep goes baa! for(var kind in animalSounds) { Logger.log("A %s goes %s!", kind, animalSounds[kind]); }Return
Object
— a copy of the properties containing key-value pairs
getProperty(key)
Deprecated. This function is deprecated and should not be used in new scripts.
Returns the value associated with the provided key, or null if there is no such value.
const specialValue = ScriptProperties.getProperty('special');Parameters Name Type Description
key
String
key for the value to retrieve Return
String
— the value associated with the key
setProperties(properties)
Deprecated. This function is deprecated and should not be used in new scripts.
Bulk-sets all the properties drawn from the given object.
ScriptProperties.setProperties({special: 'sauce', 'meaning': 42});Parameters Name Type Description
properties
Object
an object containing the properties to set. Return
ScriptProperties
— this object, for chaining
setProperties(properties, deleteAllOthers)
Deprecated. This function is deprecated and should not be used in new scripts.
Bulk-sets all the properties drawn from the given object.
// This deletes all other properties ScriptProperties.setProperties({special: 'sauce', 'meaning': 42}, true);Parameters Name Type Description
properties
Object
an object containing the properties to set. deleteAllOthers
Boolean
whether to delete all existing properties. Return
ScriptProperties
— this object, for chaining
setProperty(key, value)
Deprecated. This function is deprecated and should not be used in new scripts.
Persists the specified in value with the provided key. Any existing value associated with this key will be overwritten.
ScriptProperties.setProperty('special', 'sauce');Parameters Name Type Description
key
String
key for property value
String
value to associate with the key Return
ScriptProperties
— this object, for chaining
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-02 UTC."],[[["ScriptProperties is deprecated and should not be used in new scripts, serving as a persistent key-value store scoped per script."],["It provides methods for setting, getting, and deleting properties, but these are all deprecated."],["Despite offering functionalities like bulk operations and property retrieval, developers should refrain from using them in new projects."],["The class is primarily for legacy scripts and should be replaced with more modern alternatives for data persistence."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4