Skip to content

Application Configuration

Application Configuration documents are used to store application specific configuration (as opposed to Formbird core configuration). Configuration is stored within a field (configScript) as formatted JSON string.

Several application configurations can be defined; they are distinctly identified by their Name/Key value (.name).

Template: d3d224d0-5fd8-11e9-8fb6-2f2c499c8195

Application Configuration Document

To create an Application Configuration

  • Open the new Application Configuration document https://formbird-app-url/form/d3d224d0-5fd8-11e9-8fb6-2f2c499c8195
  • Enter your required configuration.
  • Enter a Name/Key. This must be distinct from any other application configurations that may exist.

To use in Rulesets

  • Include the ruleset include "ft3 Extension Functions"

  • Create a rule to draw the required application configuration, using the function getApplicationConfiguration, and store against ntf. Eg:

```javascript #include "ft3 Extension Functions",

...

ruleGetAppConfig : { ruleCondition : function(ntf) { ... },

ruleAction : function(ntf, callback) { 
    var ft3 = ntf.scope;

    ft3.getApplicationConfiguration(ntf, 'dexwise.test', function(configOB) {
        if (configOB) {
            ntf.appConfig = configOB;
        }
        callback();
    });
}

},

```

  • Use ntf.appConfig to draw configuration values. Eg

``` ntf.document.spiderColour = ntf.appConfig.spiderColorDefault; ntf.document.spiderWeight = ntf.appConfig.spiderWeightDefaultMG;

```

Note: Rulesets can only read the application configuration via this method.

To use in Components

(Coming soon)