Skip to content

Composing a form

A form reads as designed when it says what it is for, asks in groups, fills in what it can and explains what is not obvious. Compass’s New lead is the worked example.

Compass’s New lead: a sentence of purpose, a Person group of name, email and phone with placeholders and help, then a Lead group with its own line of description.

  • Always, give the form a description: one sentence of what a new record is for — compass/resources.ts:42.
  • When it asks for six or more fields, use groups of 3–7 fields under nouns (Person, Lead), not types (Dates, Links) — resources.ts:45.
  • When a required field has an obvious value, put it in defaults: the first state, 'today' on a created-on date, 'now' on a timestamp, 'me' on an owner — resources.ts:44.
  • When a field is not obvious, or is optional, give it help that says what to put there or what leaving it empty does, and a placeholder for its shape — resources.ts:52.
  • When a reference’s choices belong to another field’s choice (a task’s deal is one of its account’s), narrow it with where — resources.ts:158.
  • When two fields must agree, say it as validation with a sentence, beside the form — depot/resources.ts:52.
  • When a child is added from its parent’s page, give the related list a create with the few fields it needs and fill for the references the parent already knows — compass/pages/opportunity.ts:28.
  • When the form decides something against stored state, runs in steps, or is filled all day, make it a commandForm with steps and field.*({ help }) — depot/views.ts:213, depot/verbs.ts:20.

Text named like prose (notes, description) is a box of several lines on its own; fields.<name>.multiline says so for any other. The keys are in Lists, pages & forms.