Skip to content

Relationship between Rulesets & Templates

NB: The following applies to Formbird versions post 1.1.197.

Ruleset-Template-ER

A template holds several event ruleset links, defined as the following root level properties:

Property Event
onLoadClientRuleRel OnLoad
onFieldChangeClientRuleRel OnFieldChange
preSaveClientRuleRel PreSave
preSaveServerRuleRel PreSaveServer
postSaveServerRuleRel PostSave

Example Template

{
    "name": "Insect",
    "appTags": [
        "dexwise",
        "entomology",
        "insect"
    ],
    "summaryNameRule": "Insect - {{commonName}} ({{genus}} {{species}})",
    "summaryDescriptionRule": "{{description}}",
    "formColor": "#E3E3E3",
    "systemHeader": {...},
    "documentId": "07e7fbd0-cee3-11e5-aa08-fdabe14f1759",
    "components": [...],
    "onLoadClientRuleRel": [
        {
            "documentId": "78268870-8c12-11e6-8927-755e7e62df8c",
            "name": "Insect - OnLoad (JS)"
        },
        {
            "documentId": "007ba540-c833-11e7-af55-9b20b8681e48",
            "name": "Insect - OnFieldState"
        }
    ],
    "onFieldChangeClientRuleRel": [
        {
            "documentId": "569708a56f63cbc353af47fd",
            "name": "Insect - OnFieldChange"
        },
        {
            "documentId": "007ba540-c833-11e7-af55-9b20b8681e48",
            "name": "Insect - OnFieldState"
        }
    ],
    "preSaveClientRuleRel": [
        {
            "documentId": "6b139450-4952-11e6-ae2d-a99c41a4e267",
            "name": "Insect - PreSave"
        }
    ],
    "preSaveServerRuleRel": [
        {
            "documentId": "563388f0-4953-11e6-ae2d-a99c41a4e267",
            "name": "Insect - PreSaveServer"
        }
    ],
    "postSaveServerRuleRel": [
        {
            "documentId": "56524b945bec6a9d0a93bcc3",
            "name": "Insect - PostSave"
        }
    ]
}

Applying Rulesets to Templates

While it is possible to apply a Ruleset to a Template by directly editing the Template, there is available a special overlay template called "Ruleset Linker" which can be used instead.

The overlay template's document ID should be abb10be0-b9dc-11e7-8013-1f0b88022708, and placing this after a template's url with slash (/) will display the template's ruleset links as below.

Eg: https://comp-dev.formbird.com/#/form/07e7fbd0-cee3-11e5-aa08-fdabe14f1759/abb10be0-b9dc-11e7-8013-1f0b88022708

There is a link at the bottom of the overlay template which can be dragged to your bookmark bar for a quick way to view any template with this overlay.

RulesetLinkerOverlayScreen