Stay organized with collections
Save and categorize content based on your preferences.
AI-generated Key Takeaways
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.
ScriptProperties
Deprecated. 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. This function is deprecated and should not be used in new scripts.
Get all of the available keys.
Return
String[]
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.varanimalSounds=ScriptProperties.getProperties();// Logs:// A chicken goes cluck!// A cow goes moo!// A sheep goes baa!for(varkindinanimalSounds){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.
[[["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."],[],[]]