Config
Simplified configuration and local secrets storage.
The config module serves as general purpose key/value storage for organization configuration and secrets.
Configuration keys can be exported and imported using the developer tools when they are named using namespace rules (c_ or namespace__) to keep local secrets out of version control. Config keys can also be included in Deployments.
An organization can store around 256k of config data.
There are no access controls surrounding config data in-script.
module Config
keys()
Returns the list of configuration keys.
Returns
{ String[] } An array of configuration keys.
get(key)
Returns the value for a configuration key. The key can also be an object property path.
Arguments
key
{ String } The key name or object property path.
Returns
{ * } The key value.
set(key, val)
Set the value for a configuration key.
Arguments
key
{ String } The key name or object property path.val
{ * = null } The value. Overwrites the value atkey
. If null, unsets the value atkey
.
Returns
{ * } The key value.
Examples
Using get() and set()
Using convenience methods
The config module may also be called as a function for getting and setting values.
Last updated