Maintained reference:
customconditionaldatafetchis the up-to-date version of this topic. This page keeps older notes and examples.
The Custom Conditional Data Fetch Component (customconditionaldatafetch) is an enhanced version of the regular data fetch component that lets you:
Scenario: User fills in email/NID → Draft application is created. User edits email → System tries to create draft again → ERROR: Draft already exists!
Why it happens: Regular fetch component triggers on every field change, creating duplicates.
Scenario: You want to delete old draft and create new one, but both happen at the same time → ERROR: Race condition!
Why it happens: Both API calls trigger simultaneously from field change.
Scenario: Fetch executes before required data is available → ERROR: Missing required fields!
Why it happens: No way to check if prerequisites are met before calling API.
Use customconditionaldatafetch instead of customgenericdatafetch when you need to:
Use Case: Only check passport validity if document type is "Passport"
{
"key": "CHECK_PASSPORT_VALIDITY",
"type": "customconditionaldatafetch",
"props": {
"url": "/integration/v1/fetch/sync",
"label": "Check Passport Validity",
"triggerType": "FIELD_LISTENER",
"endpointCode": "PASSPORT_CHECK",
"useBaseUrl": true,
"payloadKey": "passportNumber",
"fetchCondition": {
"field": "DOCUMENT_TYPE",
"operator": "EQ",
"value": "PASSPORT"
}
}
}
How it works:
Use Case: Check if user has account → If yes, update it → If no, create new one
[
{
"key": "CHECK_ACCOUNT",
"type": "customconditionaldatafetch",
"props": {
"label": "Check Account",
"triggerType": "FIELD_LISTENER",
"endpointCode": "CHECK_USER_ACCOUNT",
"payloadKey": "userId",
"populates": [
{
"valueKey": "accountExists",
"targetKey": "ACCOUNT_EXISTS"
}
]
}
},
{
"key": "UPDATE_ACCOUNT",
"type": "customconditionaldatafetch",
"props": {
"label": "Update Account",
"triggerType": "ON_SUCCESS",
"onSuccessOf": "CHECK_ACCOUNT",
"fetchCondition": {
"field": "ACCOUNT_EXISTS",
"operator": "EQ",
"value": true
},
"endpointCode": "UPDATE_USER_ACCOUNT",
"payloadKey": "userData"
}
},
{
"key": "CREATE_ACCOUNT",
"type": "customconditionaldatafetch",
"props": {
"label": "Create Account",
"triggerType": "ON_SUCCESS",
"onSuccessOf": "CHECK_ACCOUNT",
"fetchCondition": {
"field": "ACCOUNT_EXISTS",
"operator": "EQ",
"value": false
},
"endpointCode": "CREATE_USER_ACCOUNT",
"payloadKey": "userData"
}
}
]
How it works:
When registering a business:
{
"fields": [
// User Input Fields
{
"key": "APPLICANT_EMAIL",
"type": "input",
"props": { "label": "Email", "type": "email" }
},
{
"key": "APPLICANT_DOCUMENT_NO",
"type": "input",
"props": { "label": "Document Number" }
},
// Hidden field to store status
{
"key": "CAN_NOW_INITIATE",
"type": "input",
"props": { "hideField": true }
},
// STEP 1: Check if draft exists
{
"key": "CHECK_DRAFT",
"type": "customconditionaldatafetch",
"props": {
"hideField": true,
"triggerType": "FIELD_LISTENER",
"endpointCode": "CHECK_DRAFT",
"payloadKeyMappings": [
{ "key": "email", "sourceField": "APPLICANT_EMAIL" },
{ "key": "documentNo", "sourceField": "APPLICANT_DOCUMENT_NO" }
],
"useMultiplePayloadKeys": true,
"populates": [
{
"valueKey": "can_initiate_status",
"targetKey": "CAN_NOW_INITIATE"
}
]
}
},
// STEP 2a: If draft exists, delete it
{
"key": "DELETE_DRAFT",
"type": "customconditionaldatafetch",
"props": {
"hideField": true,
"triggerType": "ON_SUCCESS",
"onSuccessOf": "CHECK_DRAFT",
"fetchCondition": {
"field": "CAN_NOW_INITIATE",
"operator": "NEQ",
"value": "success"
},
"endpointCode": "DELETE_DRAFT",
"payloadKeyMappings": [
{ "key": "email", "sourceField": "APPLICANT_EMAIL" }
],
"useMultiplePayloadKeys": true
}
},
// STEP 2b: If no draft, create directly
{
"key": "CREATE_DRAFT_DIRECT",
"type": "customconditionaldatafetch",
"props": {
"hideField": true,
"triggerType": "ON_SUCCESS",
"onSuccessOf": "CHECK_DRAFT",
"fetchCondition": {
"field": "CAN_NOW_INITIATE",
"operator": "EQ",
"value": "success"
},
"endpointCode": "CREATE_DRAFT",
"payloadKeyMappings": [
{ "key": "email", "sourceField": "APPLICANT_EMAIL" },
{ "key": "documentNo", "sourceField": "APPLICANT_DOCUMENT_NO" }
],
"useMultiplePayloadKeys": true
}
},
// STEP 3: After deleting, create new draft
{
"key": "CREATE_DRAFT_AFTER_DELETE",
"type": "customconditionaldatafetch",
"props": {
"hideField": true,
"triggerType": "ON_SUCCESS",
"onSuccessOf": "DELETE_DRAFT",
"endpointCode": "CREATE_DRAFT",
"payloadKeyMappings": [
{ "key": "email", "sourceField": "APPLICANT_EMAIL" },
{ "key": "documentNo", "sourceField": "APPLICANT_DOCUMENT_NO" }
],
"useMultiplePayloadKeys": true
}
}
]
}
First Time (No Draft):
User fills form
↓
CHECK_DRAFT → Returns "success" (no draft)
↓
CREATE_DRAFT_DIRECT → Creates new draft
(DELETE_DRAFT skipped - condition not met)
User Edits (Draft Exists):
User edits email
↓
CHECK_DRAFT → Returns "pending" (draft exists)
↓
DELETE_DRAFT → Deletes old draft
↓
CREATE_DRAFT_AFTER_DELETE → Creates new draft
(CREATE_DRAFT_DIRECT skipped - condition not met)
Result: No more "Draft already exists" errors!
onSuccessOf - Wait for Another FetchWhat it does: This fetch waits until another fetch completes successfully.
When to use: When you need fetches to happen in order (A then B then C).
Example:
{
"key": "STEP_2",
"props": {
"onSuccessOf": "STEP_1" // Wait for STEP_1 to complete
}
}
fetchCondition - Check Before FetchingWhat it does: Only execute fetch if condition is true.
When to use: When fetch should only happen in certain situations.
Structure:
{
"fetchCondition": {
"field": "FIELD_TO_CHECK", // Which field to check
"operator": "EQ", // How to compare (see operators below)
"value": "expected_value" // Value to compare against
}
}
Available Operators:
| Operator | Meaning | Example Use Case |
|---|---|---|
EQ |
Equals | Status is "ACTIVE" |
NEQ |
Not Equals | Status is not "INACTIVE" |
GT |
Greater than | Age > 18 |
LT |
Less than | Price < 1000 |
GTE |
Greater than or equals | Score >= 50 |
LTE |
Less than or equals | Amount <= 10000 |
CONTAINS |
Contains (text or array) | Email contains "@gmail.com" |
Examples:
Check if user is adult:
{
"fetchCondition": {
"field": "AGE",
"operator": "GTE",
"value": 18
}
}
Check if status is ready:
{
"fetchCondition": {
"field": "STATUS",
"operator": "EQ",
"value": "READY"
}
}
Check if email is Gmail:
{
"fetchCondition": {
"field": "EMAIL",
"operator": "CONTAINS",
"value": "@gmail.com"
}
}
triggerType: "ON_SUCCESS" - New Trigger TypeExisting Trigger Types:
FIELD_LISTENER - Runs when field changes (existing)TRIGGER_BUTTON - Runs when button clicked (existing)New Trigger Type:
ON_SUCCESS - Runs when another fetch completes successfullyWhen to use: For chained fetches. Only the first fetch should use FIELD_LISTENER, rest use ON_SUCCESS.
Example:
[
{
"key": "FIRST_FETCH",
"props": {
"triggerType": "FIELD_LISTENER" // Triggers on field change
}
},
{
"key": "SECOND_FETCH",
"props": {
"triggerType": "ON_SUCCESS", // Triggers when FIRST_FETCH completes
"onSuccessOf": "FIRST_FETCH"
}
}
]
Scenario: Fetch premium benefits only if user is premium member.
{
"key": "FETCH_PREMIUM_BENEFITS",
"props": {
"triggerType": "FIELD_LISTENER",
"fetchCondition": {
"field": "USER_TYPE",
"operator": "EQ",
"value": "PREMIUM"
}
}
}
Scenario: Only check driver's license if user is 18+.
{
"key": "CHECK_DRIVERS_LICENSE",
"props": {
"triggerType": "FIELD_LISTENER",
"fetchCondition": {
"field": "AGE",
"operator": "GTE",
"value": 18
}
}
}
Scenario: Submit → Check status → Notify → Complete
[
{
"key": "SUBMIT_REQUEST",
"props": {
"triggerType": "TRIGGER_BUTTON"
}
},
{
"key": "CHECK_STATUS",
"props": {
"triggerType": "ON_SUCCESS",
"onSuccessOf": "SUBMIT_REQUEST"
}
},
{
"key": "SEND_NOTIFICATION",
"props": {
"triggerType": "ON_SUCCESS",
"onSuccessOf": "CHECK_STATUS",
"fetchCondition": {
"field": "APPROVED",
"operator": "EQ",
"value": true
}
}
}
]
Scenario: Check if record exists → Update if exists, Create if not.
[
{
"key": "CHECK_EXISTS",
"props": {
"triggerType": "FIELD_LISTENER",
"populates": [
{ "valueKey": "exists", "targetKey": "RECORD_EXISTS" }
]
}
},
{
"key": "UPDATE_RECORD",
"props": {
"triggerType": "ON_SUCCESS",
"onSuccessOf": "CHECK_EXISTS",
"fetchCondition": {
"field": "RECORD_EXISTS",
"operator": "EQ",
"value": true
}
}
},
{
"key": "CREATE_RECORD",
"props": {
"triggerType": "ON_SUCCESS",
"onSuccessOf": "CHECK_EXISTS",
"fetchCondition": {
"field": "RECORD_EXISTS",
"operator": "EQ",
"value": false
}
}
}
]
All your existing customgenericdatafetch configurations work with customconditionaldatafetch.
Step 1: Change the type
// Before
{
"type": "customgenericdatafetch"
}
// After
{
"type": "customconditionaldatafetch"
}
Step 2: Add new features (optional)
{
"type": "customconditionaldatafetch",
"props": {
// All your existing props stay the same
"label": "Fetch Data",
"endpointCode": "MY_ENDPOINT",
// Add new features if needed
"fetchCondition": {
"field": "STATUS",
"operator": "EQ",
"value": "ACTIVE"
}
}
}
Everything from customgenericdatafetch works exactly the same:
Plus new features:
customgenericdatafetch| Property | Type | Description |
|---|---|---|
url |
string | API endpoint URL |
endpointCode |
string | Integration endpoint code |
useBaseUrl |
boolean | Use API gateway base URL |
triggerType |
string | When to trigger (FIELD_LISTENER, TRIGGER_BUTTON, ON_SUCCESS) |
payloadKey |
string | Single payload parameter |
payloadKeyMappings |
array | Multiple payload parameters |
useMultiplePayloadKeys |
boolean | Enable multiple parameters |
populates |
array | Fields to populate from response |
populateRelativeToRootForm |
boolean | Populate across sections |
debounceTime |
number | Delay in milliseconds (default: 500) |
hideField |
boolean | Hide field visually |
errorMapping |
object | Custom error handling |
showGlobalError |
boolean | Display error globally |
| Property | Type | Required | Description |
|---|---|---|---|
onSuccessOf |
string | No | Wait for this fetch to complete |
fetchCondition |
object | No | Condition to check before fetch |
fetchCondition.field |
string | If using condition | Field to check |
fetchCondition.operator |
string | If using condition | How to compare (EQ, NEQ, GT, LT, GTE, LTE, CONTAINS) |
fetchCondition.value |
any | If using condition | Value to compare against |
fetchCondition.searchInRootForm |
boolean | No | Search in root form vs local scope |
Use single entry point
FIELD_LISTENERON_SUCCESSUse hidden fields for status
{
"key": "STATUS",
"type": "input",
"props": { "hideField": true }
}
Chain related operations
Check:
fetchCondition true? (Check browser console for logs)Solution: Change chained fetches from FIELD_LISTENER to ON_SUCCESS.
Check:
{
"fields": [
{
"id": "formly_1_sections__0",
"type": "sections",
"props": {},
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null,
"fieldGroup": [
{
"key": "newSection",
"id": "formly_2_formly-group_newSection_0",
"type": "formly-group",
"props": {
"label": "New Section",
"disabled": false,
"placeholder": ""
},
"expressions": {},
"validation": {
"messages": {}
},
"fieldGroup": [
{
"key": "newBlock",
"id": "formly_3_block_newBlock_0",
"type": "block",
"props": {
"label": "New Block",
"disabled": false,
"placeholder": ""
},
"expressions": {},
"validation": {
"messages": {}
},
"fieldGroup": [
{
"key": "APPLICANT_SURNAME",
"id": "formly_20_input_APPLICANT_SURNAME_0",
"type": "input",
"props": {
"label": "Surname",
"disabled": false,
"required": true,
"placeholder": "Enter surname"
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null
},
{
"key": "APPLICANT_OTHER_NAMES",
"id": "formly_20_input_APPLICANT_OTHER_NAMES_1",
"type": "input",
"props": {
"label": "Other Names",
"disabled": false,
"required": true,
"placeholder": "Enter other names"
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null
},
{
"key": "APPLICANT_DOCUMENT_NO",
"id": "formly_20_input_APPLICANT_DOCUMENT_NO_2",
"type": "input",
"props": {
"label": "Document Number",
"disabled": false,
"required": true,
"placeholder": "Enter document number"
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null
},
{
"key": "APPLICANT_DOCUMENT_TYPE",
"id": "formly_20_customdropdown_APPLICANT_DOCUMENT_TYPE_3",
"type": "customdropdown",
"props": {
"label": "Document type",
"hidden": false,
"options": [
{
"label": "NID",
"value": "NID"
},
{
"label": "PASSPORT",
"value": "PASSPORT"
}
],
"disabled": false,
"required": true,
"bindLabel": "label",
"bindValue": "value",
"placeholder": "Select Document type",
"defaultRequired": true
},
"defaultValue": null,
"expressions": {
"props.required": "!(field?.props?.hideField || field?.hide) && field?.props?.defaultRequired"
},
"validation": {
"messages": {
"required": "This field is required."
}
},
"validators": null,
"asyncValidators": null
},
{
"key": "APPLICANT_GENDER",
"id": "formly_20_radio_APPLICANT_GENDER_4",
"type": "radio",
"props": {
"label": "Gender2",
"options": [
{
"label": "Male",
"value": "Male"
},
{
"label": "Female",
"value": "Female"
}
],
"disabled": false,
"required": false,
"formCheck": "default",
"placeholder": "",
"defaultRequired": true
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {
"required": "This field is required."
}
},
"validators": null,
"asyncValidators": null
},
{
"key": "APPLICANT_NATIONALITY",
"id": "formly_20_customdropdown_APPLICANT_NATIONALITY_5",
"type": "customdropdown",
"props": {
"code": "COUNTRY",
"label": "Nationality2asdfasdfs",
"dataset": {
"url": "/admin/v1/dataset-items/by-dataset-code/COUNTRY",
"params": {
"exclude": [
"Rwanda",
"Iran",
"North Korea"
]
},
"dataField": "data"
},
"options": [],
"subType": "CUSTOM_DROPDOWN_DATASET",
"disabled": false,
"multiple": false,
"required": true,
"bindLabel": "label",
"bindValue": "",
"useBaseUrl": true,
"placeholder": "Select country",
"defaultRequired": true
},
"defaultValue": null,
"expressions": {
"props.required": "!(field?.props?.hideField || field?.hide) && field?.props?.defaultRequired"
},
"validation": {
"messages": {
"required": "This field is required."
}
},
"validators": null,
"asyncValidators": null
},
{
"key": "APPLICANT_EMAIL",
"id": "formly_20_input_APPLICANT_EMAIL_6",
"type": "input",
"props": {
"type": "email",
"label": "Email",
"disabled": false,
"required": true,
"placeholder": "Enter email address"
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null
},
{
"key": "APPLICANT_PHONE_NUMBER",
"id": "formly_20_input_APPLICANT_PHONE_NUMBER_7",
"type": "input",
"props": {
"type": "tel",
"label": "Phone Number",
"disabled": false,
"required": true,
"placeholder": "Enter phone number"
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null
},
{
"key": "CAN_NOW_INITIATE",
"id": "formly_20_input_CAN_NOW_INITIATE_8",
"type": "input",
"props": {
"label": "CAN_NOW_INITIATE_HIDDEN",
"disabled": false,
"placeholder": ""
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null
},
{
"key": "FETCHED_DRAFT_APPLICATIONS",
"id": "formly_20_input_FETCHED_DRAFT_APPLICATIONS_9",
"type": "input",
"props": {
"label": "FETCHED_DRAFT_APPLICATIONS_HIDDEN",
"disabled": false,
"hideField": true,
"placeholder": ""
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null,
"className": "irembo-formly-hidden-field"
},
{
"key": "businessId",
"id": "formly_20_input_businessId_11",
"type": "input",
"props": {
"label": "IbusinessId_HIDDEN",
"disabled": false,
"placeholder": ""
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null
},
{
"key": "code",
"id": "formly_20_input_code_12",
"type": "input",
"props": {
"label": "code_HIDDEN",
"disabled": false,
"placeholder": ""
},
"defaultValue": null,
"expressions": {},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null
},
{
"key": "FETCH_ONGOING_APPLICATIONS",
"id": "formly_20_customconditionaldatafetch_FETCH_ONGOING_APPLICATIONS_13",
"type": "customconditionaldatafetch",
"props": {
"url": "/integration/v1/fetch/sync",
"label": "FETCH_ONGOING_APPLICATIONS",
"hidden": false,
"disabled": false,
"isStatic": false,
"required": false,
"hideField": true,
"populates": [
{
"valueKey": "draft_applications",
"targetKey": "FETCHED_DRAFT_APPLICATIONS"
},
{
"valueKey": "can_initiate_status",
"targetKey": "CAN_NOW_INITIATE"
}
],
"runAction": false,
"useBaseUrl": true,
"placeholder": "",
"triggerType": "FIELD_LISTENER",
"debounceTime": 500,
"endpointCode": "RDB_BUSINESS_FETCH_1",
"runningAction": false,
"defaultRequired": false,
"documentTypeKey": "DocumentTypeComponentKey",
"payloadKeyMappings": [
{
"key": "serviceId",
"isStatic": true,
"staticValue": "ea295b55-4d83-4b96-ae38-2791ae81c6ed"
},
{
"key": "surname",
"sourceField": "APPLICANT_SURNAME"
},
{
"key": "forename",
"sourceField": "APPLICANT_OTHER_NAMES"
},
{
"key": "personDocNo",
"sourceField": "APPLICANT_DOCUMENT_NO"
},
{
"key": "documentType",
"sourceField": "APPLICANT_DOCUMENT_TYPE"
},
{
"key": "sex",
"sourceField": "APPLICANT_GENDER"
},
{
"key": "nationality",
"sourceField": "APPLICANT_NATIONALITY"
},
{
"key": "email",
"sourceField": "APPLICANT_EMAIL"
},
{
"key": "phoneNumber",
"sourceField": "APPLICANT_PHONE_NUMBER"
}
],
"useMultiplePayloadKeys": true
},
"defaultValue": null,
"expressions": {
"props.required": "!(field?.props?.hideField || field?.hide) && field?.props?.defaultRequired",
"props.runningAction": "field?.props?.runAction"
},
"validation": {
"messages": {
"pattern": "Error message for pattern",
"required": "This field is required.",
"invalidId": "Error message for failed response",
"invalidInput": "Error message for invalid input",
"invalidGenericInput": "We are currently experiencing a technical issue that is preventing us from processing your request. Please try again later."
}
},
"validators": null,
"asyncValidators": null,
"className": "irembo-formly-hidden-field"
},
{
"key": "DELETE_DRAFT_APPLICATIONS",
"id": "formly_20_customconditionaldatafetch_DELETE_DRAFT_APPLICATIONS_14",
"type": "customconditionaldatafetch",
"props": {
"url": "/integration/v1/fetch/sync",
"label": "DELETE_DRAFT_APPLICATIONS",
"hidden": false,
"disabled": false,
"isStatic": false,
"required": false,
"hideField": true,
"populates": [
{
"valueKey": "status",
"targetKey": "CAN_NOW_INITIATE"
}
],
"runAction": false,
"useBaseUrl": true,
"onSuccessOf": "FETCH_ONGOING_APPLICATIONS",
"placeholder": "",
"triggerType": "ON_SUCCESS",
"debounceTime": 500,
"endpointCode": "RDB_DELETE_DRAFT_BUSINESS",
"runningAction": false,
"fetchCondition": {
"field": "CAN_NOW_INITIATE",
"value": "success",
"operator": "NEQ",
"searchInRootForm": false
},
"documentTypeKey": "DocumentTypeComponentKey",
"hideFromPreview": true,
"payloadKeyMappings": [
{
"key": "applications",
"sourceField": "FETCHED_DRAFT_APPLICATIONS"
}
],
"useMultiplePayloadKeys": true,
"populateRelativeToRootForm": false
},
"defaultValue": null,
"expressions": {
"hide": "(formState?.APPLICATION_STATE === 'PENDING_RESUBMISSION')",
"props.runningAction": "field?.props?.runAction"
},
"validation": {
"messages": {
"pattern": "Error message for pattern",
"required": "Error message for `required`",
"invalidId": "Error message for failed response",
"invalidInput": "Error message for invalid input"
}
},
"validators": null,
"asyncValidators": null,
"className": "irembo-formly-hidden-field"
},
{
"key": "INITIATE_APPLICATION_DIRECT",
"id": "formly_20_customconditionaldatafetch_INITIATE_APPLICATION_DIRECT_15",
"type": "customconditionaldatafetch",
"props": {
"url": "/integration/v1/fetch/sync",
"label": "INITIATE_APPLICATION_DIRECT",
"hidden": false,
"disabled": false,
"required": false,
"hideField": true,
"populates": [
{
"valueKey": "data.id",
"targetKey": "businessId"
},
{
"valueKey": "data.applicationReferenceId",
"targetKey": "code"
}
],
"runAction": false,
"useBaseUrl": true,
"onSuccessOf": "FETCH_ONGOING_APPLICATIONS",
"placeholder": "",
"triggerType": "ON_SUCCESS",
"debounceTime": 500,
"endpointCode": "RDB_INITIATE_DBR_PUSH_1",
"errorMapping": {
"detectionType": "advanced",
"useApiMessage": true,
"defaultErrorCode": "invalidGenericInput",
"errorMessagePath": "responseMessage.message"
},
"runningAction": false,
"fetchCondition": {
"field": "CAN_NOW_INITIATE",
"value": "success",
"operator": "EQ",
"searchInRootForm": false
},
"documentTypeKey": "DocumentTypeComponentKey",
"hideFromPreview": true,
"showGlobalError": true,
"payloadKeyMappings": [
{
"key": "serviceId",
"isStatic": true,
"staticValue": "ea295b55-4d83-4b96-ae38-2791ae81c6ed"
},
{
"key": "surname",
"sourceField": "APPLICANT_SURNAME"
},
{
"key": "forename",
"sourceField": "APPLICANT_OTHER_NAMES"
},
{
"key": "documentNumber",
"sourceField": "APPLICANT_DOCUMENT_NO"
},
{
"key": "documentType",
"sourceField": "APPLICANT_DOCUMENT_TYPE"
},
{
"key": "sex",
"sourceField": "APPLICANT_GENDER"
},
{
"key": "nationality",
"sourceField": "APPLICANT_NATIONALITY"
},
{
"key": "email",
"sourceField": "APPLICANT_EMAIL"
},
{
"key": "phoneNumber",
"sourceField": "APPLICANT_PHONE_NUMBER"
}
],
"useMultiplePayloadKeys": true,
"populateRelativeToRootForm": false
},
"defaultValue": null,
"expressions": {
"hide": "(formState?.APPLICATION_STATE === 'PENDING_RESUBMISSION')",
"props.runningAction": "field?.props?.runAction"
},
"validation": {
"messages": {
"pattern": "Error message for pattern",
"required": "Error message for `required`",
"invalidId": "Error message for failed response",
"invalidInput": "Error message for invalid input"
}
},
"validators": null,
"asyncValidators": null,
"className": "irembo-formly-hidden-field"
},
{
"key": "INITIATE_APPLICATION_AFTER_DELETE",
"id": "formly_20_customconditionaldatafetch_INITIATE_APPLICATION_AFTER_DELETE_16",
"type": "customconditionaldatafetch",
"props": {
"url": "/integration/v1/fetch/sync",
"label": "INITIATE_APPLICATION_AFTER_DELETE",
"hidden": false,
"disabled": false,
"required": false,
"hideField": true,
"populates": [
{
"valueKey": "data.id",
"targetKey": "businessId"
},
{
"valueKey": "data.applicationReferenceId",
"targetKey": "code"
}
],
"runAction": false,
"useBaseUrl": true,
"onSuccessOf": "DELETE_DRAFT_APPLICATIONS",
"placeholder": "",
"triggerType": "ON_SUCCESS",
"debounceTime": 500,
"endpointCode": "RDB_INITIATE_DBR_PUSH_1",
"errorMapping": {
"detectionType": "advanced",
"useApiMessage": true,
"defaultErrorCode": "invalidGenericInput",
"errorMessagePath": "responseMessage.message"
},
"runningAction": false,
"documentTypeKey": "DocumentTypeComponentKey",
"hideFromPreview": true,
"showGlobalError": true,
"payloadKeyMappings": [
{
"key": "serviceId",
"isStatic": true,
"staticValue": "ea295b55-4d83-4b96-ae38-2791ae81c6ed"
},
{
"key": "surname",
"sourceField": "APPLICANT_SURNAME"
},
{
"key": "forename",
"sourceField": "APPLICANT_OTHER_NAMES"
},
{
"key": "documentNumber",
"sourceField": "APPLICANT_DOCUMENT_NO"
},
{
"key": "documentType",
"sourceField": "APPLICANT_DOCUMENT_TYPE"
},
{
"key": "sex",
"sourceField": "APPLICANT_GENDER"
},
{
"key": "nationality",
"sourceField": "APPLICANT_NATIONALITY"
},
{
"key": "email",
"sourceField": "APPLICANT_EMAIL"
},
{
"key": "phoneNumber",
"sourceField": "APPLICANT_PHONE_NUMBER"
}
],
"useMultiplePayloadKeys": true,
"populateRelativeToRootForm": false
},
"defaultValue": null,
"expressions": {
"hide": "(formState?.APPLICATION_STATE === 'PENDING_RESUBMISSION')",
"props.runningAction": "field?.props?.runAction"
},
"validation": {
"messages": {
"pattern": "Error message for pattern",
"required": "Error message for `required`",
"invalidId": "Error message for failed response",
"invalidInput": "Error message for invalid input"
}
},
"validators": null,
"asyncValidators": null,
"className": "irembo-formly-hidden-field"
},
{
"key": "IN_PROGRESS_APPLICATION_ID",
"id": "formly_22_input_IN_PROGRESS_APPLICATION_ID_6",
"type": "input",
"props": {
"label": "IN_PROGRESS_APPLICATION_ID",
"disabled": false,
"hideField": false,
"placeholder": "",
"hideFromPreview": true
},
"defaultValue": null,
"expressions": {
"model.IN_PROGRESS_APPLICATION_ID": "(() => { const apps = model?.FETCHED_DRAFT_APPLICATIONS || []; return apps?.find((app) => app?.applicationStatus === 'IN_PROGRESS')?.id || null; })();"
},
"validation": {
"messages": {}
},
"validators": null,
"asyncValidators": null
}
]
}
]
}
]
}
]
}