Community Forum

Ask a Question
Back to All

Two fields mapping to the same outputPath

Hi,

I'm building an alteration hook whereby we want to change billing information. On the schema I have a field which could either mean company registration number or account holder id number, depending on a select box value.

{
    "key": "account_holder_id_number",
    "type": "text",
    "label": "Account Holder's ID Number",
    "outputPath": "bank_details.account_holder_id_number",
    "validators": [
      {
        "validation": {
          "type": "za_id"
        }
      }
    ],
    "displayConditions": [
      {
        "path": "id_type",
        "value": "za_id",
        "condition": "==="
      }
    ]
  },

{
    "key": "account_holder_company_registration_number",
    "type": "text",
    "label": "Company registration number",
    "outputPath": "bank_details.account_holder_id_number",
    "validators": [
      {
        "validation": {
          "type": "required"
        }
      }
    ],
    "displayConditions": [
      {
        "path": "third_party_account",
        "value": true,
        "condition": "==="
      }
    ]
  },

When submitting the form there are certain case where, if the first field is not displayed, its value is being sent to the API. Is this a known limitation or a bug?