Storage.keys()

Overview

Gets an array of all the keys for the stored items.

Added in version 1.2.109

Use Cases

Your script needs to enumerate all stored items.

Format

var storedItemKeys = Storage.keys();

Parameter Description Type Required
storedItemKeys An unordered array of keys representing stored values. Array of Strings Return Value

Example

Copy
/* Log all stored items.
 */
 
var storedItemKeys = Storage.keys();
for(var i=0;i<storedItemKeys.length;i++) {
  var item = Storage.getItem(storedItemKeys[i]);
  Logger.debug("found item '" + storedItemKeys[i] + "' with value of " + JSON.stringify(item));
}