Fields that read a fact

    A contract can choose, as everything so far has, or it can read a fact: text, a number, a date, yes or no, a code or ID, a web link or an email. You say which kind, and only the settings that kind needs appear: the unit a number is stored in, whether decimals are written 1.5 or 1,5, which way round 03/04/2024 reads, a pattern an ID must match.

    The quote rule. Whoever reads the value, a rule or the model, has to say which words it came from. Those words must really be in the record or its document, and must really say that value, or nothing is stored: the value goes to a person instead. The receipt keeps the quote, so anyone can see exactly what the value was read from.

    What a net weight field makes of three records, stored in grams
    record says                     stored   why
    ------------------------------  -------  ------------------------------------
    "Net wt. 1.2 kg"                1200     read after its label, converted to g
    "Net weight: 500g (2 x 250g)"   500      the labelled figure, not the pack
    "Best in a cool dry place"      (none)   no label, no figure: the model finds
                                             nothing stated, so a person is asked
    1. 1

      How your records say it

      The words a source announces the value with, such as “Net weight” or “Member ID”. A value after one of these is read by rules, with no model call.

    2. 2

      Try it

      A box in the editor reads a line exactly as a run will, before anything is saved.

    3. 3

      When a record doesn't say

      Ask a person, or store that it isn't stated. A date that could be read two ways asks too, unless the field says which way round dates are written.

    4. 4

      Stored as text, served typed

      A number is kept in its unit, a date as YYYY-MM-DD. A deployed tool returns numbers as numbers and takes ranges on them: {gte, lte}.