Returns key-value storage tied to the current spreadsheet or doc.
class PropertiesService method .getDocumentProperties()
PropertiesService is the Apps Script service.
.getDocumentProperties() is the method name you will see after a dot in your code.
What it does
Why it's used
- Store settings tied to this one spreadsheet file.
- Track last sync time without a hidden settings tab.
Common errors
- Forgetting parentheses on getDocumentProperties. Write PropertiesService.getDocumentProperties(), not PropertiesService.getDocumentProperties or getDocumentProperties by itself.
- Skipping dots between chained calls. Each step needs a dot, like PropertiesService.getDocumentProperties().
- Adding spaces where they do not belong. Write PropertiesService.getDocumentProperties(), not PropertiesService .getDocumentProperties(), PropertiesService.getDocumentProperties (), or PropertiesService . getDocumentProperties().
- Wrong capitalization. Use PropertiesService and getDocumentProperties, not propertiesservice or getdocumentproperties.
Explore
Related methods
-
.getUserProperties()
Returns key-value storage private to the current user.
-
.getScriptProperties()
Returns key-value storage shared by everyone using the script.
-
.getProperties()
Returns all stored key-value pairs.
-
.setProperties()
Saves multiple key-value pairs at once.
-
.getProperty()
Reads a single stored value by key.
More Apps Script
Better Sheets tutorials
No tagged tutorials yet. Fetch Apps Script from the harvest table and this page fills automatically.