google apps script properties service

Solutions on MaxInterview for google apps script properties service by the best coders in the world

showing results for - "google apps script properties service"
Ashley
12 Oct 2017
1// Sets several script properties, then retrieves them and logs them.
2
3// Initialize the service
4let documentProperties = PropertiesService.getDocumentProperties();
5// Set the properties
6documentProperties.setProperties({
7  'cow': 'moo',
8  'sheep': 'baa',
9  'chicken': 'cluck'
10});
11// Retrieve the properties
12let animalSounds = documentProperties.getProperties();
13// Loop through the properties and log them
14for (var kind in animalSounds) {
15  console.log('A %s goes %s!', kind, animalSounds[kind]);
16}
17// Logs:
18// A chicken goes cluck!
19// A cow goes moo!
20// A sheep goes baa!