Concept explainer
Validation and calculation
Explains how a form checks its own entries and computes values as they are filled, so a completed form is consistent before it is saved.
A form in Glyph checks its own entries and computes values while it is filled, so a completed form is consistent before it is saved. Validation is a rule a field carries about what a valid entry looks like. Calculation is a value a field derives from other entries as they are filled.
Checks as you fill
A field carries its checks with the form design. As staff fill the form, each entry is measured against the checks set for that field, and a value that falls outside them is flagged where it is entered.
| Check | What it holds | Caught at entry |
|---|---|---|
| Required | An entry has to be present for the form to complete. | A missing value on a required field. |
| Range | A number stays within a low and high bound. | A reading entered outside the bound. |
| Format | An entry matches a shape, such as a date or an identifier. | A value in the wrong shape. |
| Cross-field | One field's value has to agree with another. | A pair of entries that disagree. |
| Conditional | A field shows only when an earlier answer calls for it. | A field that stays hidden until it is relevant. |
Values that compute
A calculated field derives its value from other entries in the same form. As the entries it reads are filled, the calculated field recomputes, so a total, a difference or a score stays consistent with what was recorded.
A calculated field is held read-only. Staff read its value rather than typing it, so the computed result always follows from its inputs.
Sums a set of numeric fields, such as a fluid balance.
Subtracts one field from another, such as a gap between two readings.
Combines fields into an assessment score by a defined rule.
Offsets a date by an interval, such as a review date.
One place for the rules
The checks and calculations belong to the form design, in one place. Every filled copy is measured against the same rules, so two members of staff filling the same form are held to the same checks.
The version history binds a filled copy to the design it was filled against. A later change to a rule applies to forms filled from then on, and a form already completed keeps the rules that were in force when it was filled.
Consistent before it saves
A form completes once its checks pass
Validation holds completion. A form completes once its required fields carry a value and its checks agree, so a completed form is internally consistent before it is saved and locked. A calculated value recomputes from its inputs, so it stays true to the entries it was built from.
Common questions
Where do the checks run?
The checks travel with the form design and are applied to every filled copy the same way, so the outcome is consistent for each member of staff who fills the form.
Can a calculated field be edited by hand?
A calculated field is read-only. It follows from the fields it reads, so its value stays consistent with the entries it was derived from.
What happens if a required field is empty?
The form holds at draft until the required entry is present. Once every required field carries a value and the checks agree, the form completes.
Read how a completed form is filled and locked.