Prior to this release, a developer could create a dependency within their function on configuration variables. These functions would require the creation of a corresponding configuration variable in the web app settings in order to operate successfully.
With this release, we have enhanced the sked.proj.json file, defined as part of the function, to support default values. This makes the configuration variable optional from the perspective of the implementation. An administrator no longer has to manually create a corresponding configuration variable via the web app UI.
If you create a configuration variable with the same name via the web app UI, the value you supply in that definition will be used instead of the default.
Adding a default value to the variable
Below is an example of a sked.prog.json that includes an optional variable.{
"type": "function",
"version": "2",
"name": "geocode-address-function",
"description": "A function that geocodes the address of a record",
"runtime": "nodejs18.x",
"settings": {
"configVars": {
"ACCEPT_STREET_ADDRESS_ONLY": {
"description": "Accept the geocode result only if granularity = streetAddress. Accepts values TRUE or FALSE.",
"configType": "plain-text",
"default":"TRUE"
}
}
}
}