Swasti · mForm V2→V3

11 — Member form authoritative flow (PM video)

Authority: PM Fahim’s voiceover walkthrough of mForm V2 production, recorded 2026-05-19 (7:58 mobile screen capture). This note + the embedded spec under pm-spec/2026-05-19/ are the source of truth for the Member doctype flow going forward. When this contradicts the V2 form 1000 JSON (raw/mform-forms/1000.json), the video wins; when the video doesn’t show a picker, fall back to the V2 JSON for option lists.

Key realisation: viewSequence, not order

V2 has two numbering schemes per question and we built off the wrong one:

FieldPurposeUse for
question.orderStable question ID (never changes; how parent[].order refers)xref / conditional logic / serialisation
question.viewSequenceDisplay position 1..N in V2’s rendered formUI rendering order

Our V3 ordered the form by order (which is just question ID) and broke it into 7 paged sections. V2 production renders all 56 questions as one continuous scroll, ordered by viewSequence, with a single collapsible header — V2 order 20 “Additional Details” at viewSeq 33 — and one Submit button at the bottom.

Form shape (from video)

  • Single vertically-scrolling form. No wizard, no Continue buttons, no progress indicator.
  • Server-rendered. On open, a centred overlay reads Creating questions... (NN%).. while the form is generated. Only field 1 is visible until then.
  • Consent gate at viewSeq 1. Field 1 (Consent Form) is a button-style control. Until it equals Agree, fields 2-N stay hidden AND the field shows a red outline. PM voiceover: “Go to consent, agree.” [00:54-00:59].
  • One collapsible mid-form at viewSeq 33 (V2 order 20, Additional Details), expanded by default.
  • One Submit button, red pill, bottom-right. Success banner inline: ✓ Form submitted successfully.
  • Top-left X to close.
  • Post-submit routing: the answer to viewSeq 31 (Civic ID already present) determines which form opens next.
    • No → Document Application flow (“the document application forms… needs to be filled out”)
    • Yes → Scheme Application + Health Screening flow

Loading state: "Creating questions... (NN%).."

Consent invalid → red outline + rest hidden

After Agree → fields 2+ reveal

Field-by-field (viewSequence order)

Render order matches V2 viewSequence. The V2 shortKey + order columns are for cross-referencing the JSON and the Frappe doctype fieldname. Conditional rule comes from V2 question.parent[] (skipping the consent-gate reference, which is form-level not field-level). All option lists and exact validation rules: read from raw/mform-forms/1000.json.

SeqLabel (V2 title)V2 shortKey (= Frappe fieldname)V2 orderConditional show-whenNotes
1Consent Formconsent_form (mapped from order19)19always (it IS the gate)Must equal Agree. Red outline until satisfied. Hides 2-N. Popup info text appears on open.
2Statestate1Auto-populated from logged-in user’s region (override allowed)
3Districtdistrict2Cascade from state
4Blockblock3Cascade from district
5Grampanchayatgram_panchayat34Cascade from block. Triggers Donor/Partner auto-populate
6Donor Namename_donor36Auto-populated from Donor Master based on Grampanchayat; dropdown remains overridable
7Partner Nameorder3838Auto-populated (gray placeholder); free-text input
8Individual Facilitatorsurveyor37Two-control: text input + Get button. Tapping Get populates the text with the logged-in user’s display name. Get disappears after population.
9Villagevillage35Cascade from Grampanchayat
10Enter Nameb_pro_name4Alphanumeric
11Father’s/Spouse name of the memberorder55Alphanumeric
12Enter Date of Birthb_prof_dob6Wheel-style 3-column picker (Day / Month / Year); displays DD-MM-YYYY; CANCEL / OK
13Ageorder3232Auto-calculated from DOB. Read-only (gray). Range 0-130 (V2 raw says 0-200; tighter cap is policy — see feedback_swasti_age_max_130).
14Addressorder3131Multi-line textarea
15Phone Numberb_prof_mob7Numeric, 10-digit Indian mobile ^[6-9]\d{9}$
16Category of Phone Numbercateg_phone43Self / Other (full list in V2 JSON)
17Genderb_prof_sex8Radio: Male / Female / Trans (V2 uses “Trans” not “Transgender”)
18Number of members in the householdorder6363Numeric. Currently missing from our V3 implementation.
19Education Qualificationorder4545Dropdown
20Religionb_prof_reli14Dropdown
21Occupation Statusoccup_status39Dropdown: Employed / Unemployed / Retired / Student / Homemaker (verify in V2 JSON)
22Occupationb_prof_occ11occup_status = EmployedSearchable picker (20 entries) with A-Z sort toggle. List in V2 JSON.
23Please specify if selected “Other”other_occupation41b_prof_occ = OtherFree text
24Annual Incomeb_prof_inc12Numeric, max 10 digits
25Vulnerability Status of Householdorder4646Multi-select modal with checkboxes + OK button. 10 options (Female-headed, Elderly-only, Disabled-member, Chronically-ill, Single-parent, Recent-migrant, Landless, Below-poverty, Child-headed, None).
26Income Stabilityorder4747Dropdown
27Marital Statusorder1313Dropdown
28Casteorder1515Vertical radio: OBC, ST, SC, General, BC, MBC, FC, PVTG
29Please specify if selected PVTGother_pvtg40order15 = PVTGDropdown
30Please specify if selected “Others”others_pvtg42other_pvtg = OthersFree text
31Civic ID already present with memberorder1616Radio Yes/No. Drives post-submit routing. PM: “here comes the main question which is CV ID already present with the member.” [01:56-02:09]
32Which documents do you have?b_prof_doc18order16 = YesSearchable multi-select modal with 12 entries (Aadhaar, PAN Card, Voter ID, Ration Card, Bank Account, Community Certificate, Family ID, Income Certificate, Passport, Birth Certificate, Death Certificate, Domicile Certificate).
33Additional Details (section header — collapsible, expanded by default)order2020V2 input type 22 (section header). Renders as collapsible group containing seq 34-48 below.
34Disabledorder1717Radio Yes/No
35Type of Disabilityorder4848order17 = YesDropdown
36Please specify if selected “Other”order4949order48 = OtherFree text
37Please attach the Disability Certificateorder6262order17 = YesFile upload (Phase 6)
38Have you heard about social protection schemes for ex. PDS, MGNREGA, AYUSHMAN Bharat etc?order5050Yes/No
39If yes to above, Where did you hear about it from?order5151order50 = YesMulti-select modal. Options: Television/Radio, Newspapers, Government officials, NGO/Social workers, Community meetings, Friends/Neighbors, Social media/Internet, Other
40Please specify if selected “Other”order5252order51 includes OtherFree text
41Have you ever applied for any social protection scheme?order5353order50 = YesYes/No
42Did you receive the benefits after you applied?order5454order53 = YesYes/No
43What were the reasons?order5555order54 = NoDropdown
44Did you attend any Awareness Camps on government scheme in last 12 months?order5656Yes/No
45Have you received any training on digital/financial literacy in the past?order5757Yes/No
46Do you own a smart phone?order5858Yes/No
47If YES to above, then - What is your level of comfort with using mobile phones and digital services?order5959order58 = YesDropdown
48What are your consistent challenges in access Government Schemes? (Multi-Select)order6060Multi-select. Label literally contains the string “(Multi-Select)”. Sample values from video: Required documents not available, Corruption/bribes demanded
49Please specify if selected “Others”order6161order60 includes OthersFree text
50If you want to store more IDs - select number hereorder2424Dropdown: 1 / 2 / 3
51Name of Other ID 1order2525order24 ∈ {1, 2, 3}Text
52Upload Image for ID 1order2828order24 ∈ {1, 2, 3}File upload
53Name of Other ID 2order2626order24 ∈ {2, 3}Text
54Upload Image for ID 2order2929order24 ∈ {2, 3}File upload
55Name of Other ID 3order2727order24 = 3Text
56Upload Image for ID 3order3030order24 = 3File upload

Note on placement of “more IDs” block: the video shows the “store more IDs” question at the bottom of the form (after the awareness/training/smartphone block) rather than alongside the main document multi-select. This matches V2 viewSequence 50-56. The doctype evals (depends_on, mandatory_depends_on) already exist for these and behave correctly in Frappe.

Donor Name picker DOB wheel picker Occupation searchable picker Vulnerability multi-select modal Caste radio + Civic ID Civic ID = Yes → documents multi-select Documents picker (12 entries) Awareness source multi-select Submit success banner

Special behaviours (not in V2 JSON)

These are V2 production behaviours visible in the video but not encoded in the form JSON — they live in V2 backend code. We need to recreate them in V3.

  • Field 1 is a “button”-style control, not the dropdown/radio our current implementation uses
  • Tapping it opens a popup with consent text + Agree / Disagree buttons (mForm V2 production behaviour — exact wording to confirm with PM)
  • Until consent_form == 'Agree', fields 2-N stay hidden, and the consent control shows a red outline
  • Submit is blocked until consent is given

2. Auto-populate triggered by Grampanchayat

When viewSeq 5 (Grampanchayat) is selected:

  • viewSeq 6 (Donor Name) auto-fills from Donor Master, keyed by gram_panchayat
  • viewSeq 7 (Partner Name) auto-fills (gray placeholder shows the populated value)
  • Both remain user-overridable

PM quote: “donor name or partner name are auto populated. These are the based on the gram banchan.” [01:02-01:09] · “this member profiling form is connected to donor master form.” [01:09-01:14]

Data source: Donor Master (V2) — we have the export at raw/mongo-export/donormasters.jsonl. Mapping: donormaster.gram_panchayat → donormaster.donor_name + .partner_name.

3. Individual Facilitator “Get” button

viewSeq 8 renders as [ text input ] [ Get ]. Tapping Get populates the text with the logged-in user’s display name (e.g. Test SP User). The Get button disappears once populated. Maps to Frappe surveyor (V2 order 37) which on our side is set to the logged-in user automatically — we already have this server-side, we just need the visible Get-button UI affordance to match the V2 UX.

4. Server-side schema generation (loader)

V2 production renders a Creating questions... (NN%).. overlay while the form schema is fetched. Our V3 has the manifest baked into the client (faster) — we should still show a brief skeleton loader on form open to match the perceived behaviour, even though the schema is local.

5. Post-submit routing

The Civic ID answer (order16) determines what opens next:

  • No → Document Application form (user is missing IDs, needs to apply)
  • Yes → Scheme Application form + Health Screening form (user has IDs, ready for benefit enrollment)

PM quote: “If we select no… the document application forms… needs to be filled out.” [02:09-02:24] · “When I click on yes the scheme application and then screening are filled up.” [03:13-03:18]

Implementation: on successful Member save, branch on the just-submitted order16 value to push the appropriate next-form route.

Gap vs current V3 Flutter implementation

AreaCurrent V3 (May 19)Should be (per video)
Layout7 paged sections with Continue buttonsOne scroll. One Additional Details collapsible at viewSeq 33.
Field orderBy V2 order (question ID)By V2 viewSequence
Consent placementLast step (we moved it after PM ask earlier today)Field 1, top. With popup text + Agree/Disagree, red outline gate.
Donor auto-populateManual pickerAuto-fill on Grampanchayat select; overridable
Partner auto-populateNot presentAuto-fill on Grampanchayat select; overridable
Individual Facilitator fieldNot rendered (server-side surveyor only)Rendered with Get button
order63 Number of household membersNot renderedNumber input at viewSeq 18
Field labelsParaphrased (“Full name”)Verbatim (“Enter Name”, “Father’s/Spouse name of the member”, etc.)
Gender optionTransgenderTrans
Caste optionsNeed to verify against V2 verbatimOBC, ST, SC, General, BC, MBC, FC, PVTG
Vulnerability pickerPlain checkbox list (verify)Modal with checkboxes + OK button
Occupation pickerPlain dropdownSearchable picker with A-Z sort, “(20)” count badge
Documents pickerPlain checkbox listSearchable modal, “(12)” count badge
Submit success feedbackReturns to listGreen inline banner ✓ Form submitted successfully on home dashboard above bottom tab
Post-submit next formNoneBranch on order16 → Document Application or Scheme + Health

What we KEEP unchanged from the current V3

  • FormValidationSpec + reactive visibleWhen / requiredWhen evaluator (FX5)
  • FX4 audit + FX5 codegen → kFormValidationSpecs
  • Frappe Member doctype + member.py server validators
  • Offline-first SDK, outbox, sync (syncAll, REST push)
  • Login + Member-list + Member-detail screens (only the ADD/EDIT screen changes)

Open items to confirm with PM

  1. Exact consent popup wording — the video shows the popup briefly but resolution doesn’t allow verbatim capture
  2. Caste option order in V2 JSON vs video (some labels were not enumerated in the picker on camera)
  3. Education / Religion / Occupation Status / Income Stability / Marital Status full option lists (pickers never opened on camera; V2 JSON should suffice)
  4. Whether Donor Master cascade keys on gram_panchayat ID or label
  5. Whether Get on Individual Facilitator should also populate when re-opening a draft (yes/no)
  6. Whether post-submit “Scheme + Health” means both open or a chooser is shown

Source files

  • PM video: /Users/abhijitnair/Downloads/Video 1 from SharePoint.mp4 (7:58)
  • Structured spec: pm-spec/2026-05-19/SPEC.md (473 lines, all 5 forms)
  • Screenshots (Form 1, 22 frames): pm-spec/2026-05-19/screenshots/f1_*.jpg
  • V2 form JSON: raw/mform-forms/1000.json (56 questions)
  • V2 viewSequence dump: audit/out/member_view_order.json

This note is the authority. Subsequent PM videos for Scheme Application, Scheme Followup, Document Application, and Document Application Followup will become notes 12-15.


Last updated 2026-05-04