Vibha's data and monitoring platform · vibha.org

Build a form, step by step

Three forms, built field by field, each written to exercise a different corner of the builder — an intake form for logic and calculation, a monitoring visit for cascading dropdown lists and repeating sections, and a scored assessment for the scale question types. Every field named below is a real type in Field types, and every rule is real syntax from Rules and calculations.

Example 1 — Programme intake, with an age calculation and a conditional requirement

An intake form for a scholarship programme: applicant details, an automatically computed age, and a second ID document that only some applicants need to provide.

  1. 1Page 1 — Applicant. Add a Short answerfield labelled “Full name” and mark it Required. Add a Datefield labelled “Date of birth”, also required. The builder derives their keys — full_name and date_of_birth — the moment you save, from the labels.
  2. 2Add a Numberfield labelled “Age (years)”. Leave it blank for now — this is the field a rule is about to own.
  3. 3Open Rules and add a Calculate rule targeting age_years, either from the “Age from date of birth” template or built by hand: yearsBetween(date_of_birth, today()). From this point the Age field is read-only in the form — the respondent sees it fill in as soon as they pick a date of birth.
  4. 4Add a Select an optionfield labelled “District” and bind its options to your districts dropdown list, rather than typing the options in by hand — see Dropdown lists for how a list is uploaded once and reused.
  5. 5Page 2 — Household. Add a Numberfield labelled “Household size”, required. Add a File uploadfield labelled “Additional ID document” — leave it not required; a rule is about to decide that.
  6. 6Add a Require rule targeting the ID upload field: gt(household_size, 6). Households above six people must provide the second document; everyone else can leave it blank and submit normally.

Page 1 — Applicant

Full name

Short answer

Required

Date of birth

Date

Required

Age (years)

Number · read-only

Calculated

District

Select an option · dropdown list: districts

Page 2 — Household

Household size

Number

Required

Additional ID document

File upload · required above 6 people

Conditional

Example 2 — Field monitoring visit, with cascading location and a repeating section

A monitoring visit form for a field team: a location that narrows in three steps, and a repeating block for however many issues the visit turns up — none, one, or a dozen.

  1. 1Add three Select an optionfields — “District”, “Block”, “School” — bound to three dropdown lists that cascade: Block's options are filtered to the ones whose parent is the chosen District, and School's to the chosen Block. The respondent never sees a school from the wrong district. Full mechanics in Cascading and lookups.
  2. 2Add a Datefield labelled “Visit date”, required.
  3. 3Add a Repeating sectionlabelled “Issues found”, containing two sub-questions: a Select an optionfor “Issue type” (Water supply, Sanitation, Electricity, Other) and a Long answerfor “Description”. The field worker adds one entry per issue and can add zero.
  4. 4Add a Number field labelled “Total issues” and a Calculate rule targeting it: count(issues_found) — the running count updates as entries are added or removed, with nothing for the field worker to tally by hand.

Location — cascading

District

Select an option · dropdown list: districts

Block

Select an option · cascades from District

Cascading

School

Select an option · cascades from Block

Cascading

Visit

Visit date

Date

Required

Issues found

Repeating section · Issue type, Description per entry

Total issues

Number · read-only

Calculated

Example 3 — Training feedback, with scales and a validated range

A short feedback form built around the rating field types, laid out in Grid mode so it fits on one screen instead of a long scroll.

  1. 1In Form settings, set the layout to Grid. Short questions now sit two to a row automatically — see Pages and layout for which types take a half row and which always take the whole one.
  2. 2Add a Star ratingfield labelled “Overall quality”.
  3. 3Add an NPSfield labelled “How likely are you to recommend this training?” — the standard eleven-point 0–10 scale, always full width since eleven buttons in a row need it.
  4. 4Add a Matrixfield labelled “Rate each session” with one row per session and columns Poor / Fair / Good / Excellent.
  5. 5Add a Number field labelled “Minutes spent”. Set its Minimum value and Maximum value in the Validation box to keep the answer plausible. (Min and max digits are a separate setting, for fixed-length codes.) For limits that depend on other answers, use a rule instead — see below.
  6. 6Add a Validate rule catching an implausible number of minutes — not(between(minutes_spent, 0, 600))— with the message “Minutes spent should be between 0 and 600.”
  7. 7Add a second Validate rule for the rare case a single field can not express on its own: the NPS score and the star rating disagreeing badly enough to be worth a second look — and(lt(overall_quality, 3), gt(recommend_score, 8)), with the message “A low quality rating alongside a high recommendation score — please check both answers.”

Feedback (Grid layout)

Overall quality

Star rating · half width

Recommend score

NPS · full width

Rate each session

Matrix · full width

Minutes spent

Number · full width