Google Apps Script

Properties Service

This service allows scripts to store strings as key-value pairs scoped to one script, one user of a script, or one document in which an add-on is used. For more information about when to use each type of property, see the guide to the Properties service.

Classes

NameBrief description
PropertiesThe properties object acts as the interface to access user, document, or script properties.
PropertiesServiceAllows scripts to store simple data in key-value pairs scoped to one script, one user of a script, or one document in which an add-on is used.
ScriptPropertiesScript Properties are key-value pairs stored by a script in a persistent store.
UserPropertiesUser Properties are key-value pairs unique to a user.

Class Properties

Methods

MethodReturn typeBrief description
deleteAllProperties()PropertiesDeletes all properties in the current Properties store.
deleteProperty(key)PropertiesDeletes the property with the given key in the current Properties store.
getKeys()String[]Gets all keys in the current Properties store.
getProperties()ObjectGets a copy of all key-value pairs in the current Properties store.
getProperty(key)StringGets the value associated with the given key in the current Properties store, or null if no such key exists.
setProperties(properties)PropertiesSets all key-value pairs from the given object in the current Properties store.
setProperties(properties, deleteAllOthers)PropertiesSets all key-value pairs from the given object in the current Properties store, optionally deleting all other properties in the store.
setProperty(key, value)PropertiesSets the given key-value pair in the current Properties store.

Class PropertiesService

Methods

MethodReturn typeBrief description
getDocumentProperties()PropertiesGets a property store that all users can access within the current document, if the script is published as an add-on.
getScriptProperties()PropertiesGets a property store that all users can access, but only within this script.
getUserProperties()PropertiesGets a property store that only the current user can access, and only within this script.

Class ScriptProperties

Class UserProperties

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.