Components

customcrvsidinput

An identity input specialised for CRVS (Civil Registration and Vital Statistics) lookups, validating against the configured CRVS endpoint.

An identity input specialised for CRVS (Civil Registration and Vital Statistics) lookups, validating against the configured CRVS endpoint.

Read Form Rules before using this component — keys, labels, required fields, expressions, visibility, and validation all follow shared conventions.

When to use

  • The form needs to verify a civil-registration document (birth certificate, death certificate, marriage certificate, etc.) against a CRVS endpoint
  • The CRVS lookup should populate downstream fields with the response data

When NOT to use

Instead of customcrvsidinput, use…For…
customidinputGeneral-purpose NID / passport / refugee ID lookup
customdoubleidinputPaired identity lookup (e.g. husband + wife in one record)
customapplicationnumberinputLooking up an existing application by its application number

Props

The full prop surface mirrors customidinput (label, required, defaultRequired, url, endpointCode, useBaseUrl, populates, hideField) with the addition of CRVS-specific configuration. Verify exact prop names against the running UI library before shipping.

PropTypeRequired?Description
labelstringrequiredVisible label.
requiredbooleanrequiredAlways false. The expression controls the runtime value.
defaultRequiredbooleanrequiredtrue for required fields, false for optional ones.
endpointCodestringrequiredIntegration endpoint code for the CRVS lookup.
urlstringrequiredIntegration endpoint path — typically /integration/v1/fetch/sync.
useBaseUrlbooleanoptionalPrepend the API gateway base URL to url. Set true for production.
populatesarrayoptional{ valueKey, targetKey } mappings to auto-fill downstream fields from the response.
hideFieldbooleanoptionalHides the field and excludes its value from submission. Toggle via expressions["props.hideField"].

Examples

Minimal — birth certificate lookup

{
  "key": "BIRTH_CERTIFICATE",
  "type": "customcrvsidinput",
  "props": {
    "label": "Birth Certificate Number",
    "required": false,
    "defaultRequired": true,
    "url": "/integration/v1/fetch/sync",
    "useBaseUrl": true,
    "endpointCode": "FGETBIRTHRECORD"
  },
  "expressions": {
    "props.required": "!(field?.props?.hideField || field?.hide) && field?.props?.defaultRequired"
  },
  "validation": {
    "messages": {
      "required": "Birth certificate number is required.",
      "invalidId": "We could not verify this certificate. Please check the number and try again."
    }
  }
}

Full example — with populates

{
  "key": "BIRTH_CERTIFICATE",
  "type": "customcrvsidinput",
  "props": {
    "label": "Birth Certificate Number",
    "required": false,
    "defaultRequired": true,
    "url": "/integration/v1/fetch/sync",
    "useBaseUrl": true,
    "endpointCode": "FGETBIRTHRECORD",
    "populates": [
      { "valueKey": "firstName", "targetKey": "CHILD_FIRST_NAME" },
      { "valueKey": "surname", "targetKey": "CHILD_LAST_NAME" },
      { "valueKey": "dateOfBirth", "targetKey": "CHILD_DOB" },
      { "valueKey": "placeOfBirth", "targetKey": "CHILD_PLACE_OF_BIRTH" }
    ]
  },
  "expressions": {
    "props.required": "!(field?.props?.hideField || field?.hide) && field?.props?.defaultRequired"
  },
  "validation": {
    "messages": {
      "required": "Birth certificate number is required.",
      "invalidId": "We could not verify this certificate. Please check the number and try again."
    }
  }
}

Validation messages

The CRVS widget emits the generic identity error keys. See Cross-field Validators and the identity-validator section for the exhaustive list. The common ones:

  • required — field is empty
  • invalidId — lookup API failed or returned no match

Common mistakes

  • Setting required: true directly — use the required: false + defaultRequired: true + expression pattern from Form Rules.
  • Omitting endpointCode — the component cannot resolve a lookup endpoint and the fetch fails silently.
  • Forgetting useBaseUrl: true in production — the request is sent to a relative path with no host and fails.
  • Pointing populates at fields that don't exist in the form — the response data is dropped.
  • Reusing this widget for non-CRVS lookups — use customidinput for general identity verification.

Checklist

  • key is UPPER_SNAKE_CASE and unique across the entire form
  • props.label is present, unique, and correctly cased
  • Field is nested at the correct depth: sections > formly-group > block > customcrvsidinput
  • required: false is set (never true)
  • defaultRequired is set (true or false)
  • expressions["props.required"] is present with the exact required expression
  • endpointCode matches a known CRVS integration endpoint
  • url and useBaseUrl are configured per environment
  • If populates is used, every targetKey corresponds to a declared field
  • validation.messages.required and validation.messages.invalidId are both present

On this page