A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/apps-script/guides/properties below:

Properties Service | Apps Script

Skip to main content Properties Service

Stay organized with collections Save and categorize content based on your preferences.

The Properties service lets you 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. It is typically used to store developer configuration or user preferences. Properties are never shared between scripts.

To view the daily quotas and storage limits for the Properties service, see Quotas for Google Services.

Comparison of property stores

The PropertiesService global object offers three methods, each of which returns a similar Properties object but with different access rights, as shown in the following table:

Script Properties User Properties Document Properties Method to access getScriptProperties() getUserProperties() getDocumentProperties() Data shared among All users of a script, add-on, or web app The current user of a script, add-on, or web app All users of an add-on in the open document Typically used for App-wide configuration data, like the username and password for the developer's external database User-specific settings, like metric or imperial units Document-specific data, like the source URL for an embedded chart Data format

The Properties service stores all data as strings in key-value pairs. Data types that are not already strings are automatically converted to strings, including methods contained within saved objects.

Saving data

To save a single value, call the method Properties.setProperty(key, value) of the appropriate store, as shown in the following example:

To save data in bulk, pass a map of key-value pairs to Properties.setProperties(properties). Each key-value pair of the object in the parameter is stored as a separate property:

Reading data

To retrieve a single value that you have previously saved, call Properties.getProperty(key):

To retrieve all values in the current property store, call Properties.getProperties():

Modifying data

The methods getProperty() and getProperties() return a copy of the stored data, not a live view, so changing the returned object will not update the value in the property store. To update the data in the store, simply save it again:

Deleting data

To delete a single value, call Properties.deleteProperty(key):

To delete all properties in the current store, call Properties.deleteAllProperties():

Manage script properties manually

You can manually add up to fifty custom properties, as strings in key-value pairs, from the project settings page. To add more than fifty properties, you need to add them programmatically using the methods described above in Saving data. When you set script properties from the project settings page, you can’t reference script variables.

Add script properties
  1. Open your Apps Script project.
  2. At the left, click Project Settings .
  3. To add the first property, under Script Properties click Add script property.
  4. To add second and subsequent properties, under Script Properties click Edit script properties > Add script property.
  5. For Property, enter the key name.
  6. For Value, enter the value for the key.
  7. (Optional) To add more properties, click Add script property.
  8. Click Save script properties.
Edit script properties
  1. Open your Apps Script project.
  2. At the left, click Project Settings .
  3. Under Script Properties, click Edit script properties.
  4. Make changes to the key name and key value for each property you want to change.
  5. Click Save script properties.
Delete script properties
  1. Open your Apps Script project.
  2. At the left, click Project Settings .
  3. Under Script Properties, click Edit script properties.
  4. Next to the property that you want to delete, click Remove close.
  5. Click Save script properties.

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 2025-08-04 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 2025-08-04 UTC."],[[["The Properties service allows you to store simple data as key-value pairs, with separate stores for script, user, and document properties."],["Data is stored as strings and automatically converted if it's a different data type, with access varying depending on the chosen property store."],["You can save, read, modify, and delete data within these property stores using specific methods provided by the Properties service."],["Script properties can also be managed manually through the project settings page for a limited number of custom properties."]]],[]]


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