Skip to content

Components

Components themselves are 'templates' in their own way. Like a template, the component has parameters which define how the component functions, what to display and how to display it. eg. There is a component called 'sc-numeric' which can have a min and max value. When a user enters data into the component, sc-numeric executes code to check if the values are within the min / max parameters.

Components are added to the component array on the template to create a set of key/value pairs for a document when saved (systemHeader.systemType:document). When saved, a component will write the data entered into the component to the document and when a document is opened, the components display the data written on the document.

  "components": [
        {
            "componentName": "sc-date-time",
            "label": "Date Submitted",
            "name": "dateSubmitted"
        },
        {
            "componentName": "sc-text-box",
            "label": "Reproducibility",
            "name": "reproducibility"
        },
        {
            "componentName": "sc-drop-down",
            "label": "Severity",
            "name": "issueSeverity",
            "dropDownList": [
                "Trivial",
                "Minor",
                "Major",
                "Critical"
            ]
        }
    ]

Component definition varies with the component, but in general, all components require a minimum of two parameters, componentName and name;
Components do not necessarily always create key/value pairs, some components can be used for only displaying data.

Formbird has (at time of writing) 40 components, with new ones being developed and existing ones given extra functionality all of the time. These cover a range of functions including mapping, text entry, numeric entry, date entry, establishing document 'relationships', data display and more. Reference the 'components guide' to see a complete list