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… |
|---|---|
customidinput | General-purpose NID / passport / refugee ID lookup |
customdoubleidinput | Paired identity lookup (e.g. husband + wife in one record) |
customapplicationnumberinput | Looking 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.
| Prop | Type | Required? | Description |
|---|---|---|---|
label | string | required | Visible label. |
required | boolean | required | Always false. The expression controls the runtime value. |
defaultRequired | boolean | required | true for required fields, false for optional ones. |
endpointCode | string | required | Integration endpoint code for the CRVS lookup. |
url | string | required | Integration endpoint path — typically /integration/v1/fetch/sync. |
useBaseUrl | boolean | optional | Prepend the API gateway base URL to url. Set true for production. |
populates | array | optional | { valueKey, targetKey } mappings to auto-fill downstream fields from the response. |
hideField | boolean | optional | Hides 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 emptyinvalidId— lookup API failed or returned no match
Common mistakes
- Setting
required: truedirectly — use therequired: false+defaultRequired: true+ expression pattern from Form Rules. - Omitting
endpointCode— the component cannot resolve a lookup endpoint and the fetch fails silently. - Forgetting
useBaseUrl: truein production — the request is sent to a relative path with no host and fails. - Pointing
populatesat fields that don't exist in the form — the response data is dropped. - Reusing this widget for non-CRVS lookups — use
customidinputfor general identity verification.
Checklist
-
keyisUPPER_SNAKE_CASEand unique across the entire form -
props.labelis present, unique, and correctly cased - Field is nested at the correct depth:
sections > formly-group > block > customcrvsidinput -
required: falseis set (nevertrue) -
defaultRequiredis set (trueorfalse) -
expressions["props.required"]is present with the exact required expression -
endpointCodematches a known CRVS integration endpoint -
urlanduseBaseUrlare configured per environment - If
populatesis used, everytargetKeycorresponds to a declared field -
validation.messages.requiredandvalidation.messages.invalidIdare both present
customconditionaldatafetch
A guarded variant of customgenericdatafetch that skips duplicate calls, chains dependent fetches, and conditionally fires only when a fetchCondition is met.
customcurrencyformatinput
A monetary amount input that displays comma-formatted values (e.g. 1,000,000 RWF) while preserving the raw formatted string in the model.