google apps script properties service
snippet in javascript

google apps script properties service

user1147

// Sets several script properties, then retrieves them and logs them.

// Initialize the service
let documentProperties = PropertiesService.getDocumentProperties();
// Set the properties
documentProperties.setProperties({
  'cow': 'moo',
  'sheep': 'baa',
  'chicken': 'cluck'
});
// Retrieve the properties
let animalSounds = documentProperties.getProperties();
// Loop through the properties and log them
for (var kind in animalSounds) {
  console.log('A %s goes %s!', kind, animalSounds[kind]);
}
// Logs:
// A chicken goes cluck!
// A cow goes moo!
// A sheep goes baa!