Skip to content

Instantly share code, notes, and snippets.

@phillypb
Last active March 21, 2023 12:00
Show Gist options
  • Save phillypb/61e2d9252e4d7b0dbf20a2b8dbe56b03 to your computer and use it in GitHub Desktop.
Save phillypb/61e2d9252e4d7b0dbf20a2b8dbe56b03 to your computer and use it in GitHub Desktop.
function saveToProperties() {
// save to User Properties in one go
var userProperties = PropertiesService.getUserProperties();
var newProperties = {
sourceFolderId: '123',
destinationFolderId: '456',
};
userProperties.setProperties(newProperties);
Logger.log("Successfully stored User Properties");
}
function getFromProperties() {
// run Function to get from User Properties
var userProperties = PropertiesService.getUserProperties().getProperties(); // returns an Object
Logger.log(userProperties);
// log each item from User Properties
Logger.log(userProperties.destinationFolderId);
Logger.log(userProperties.sourceFolderId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment