Skip to content

Hidden Properties

Hidden Properties provides plugin developers capability to provide properties that will be shown to user once certain conditions or checks are successful based on user inputs. Hidden Properties help plugin developers control the flow of user inputs by showing only the required properties at first and show the remaining properties based on the user input afterward.

The hideExpression accepts an expression that evaluates to a boolean value. The expression can access values from other properties. Access values from other properties as below:

model.<property_name>
{
  "X": "", 
  "Y": ""
}
  • Use the model.<property_name> when the properties are string, boolean, number or integer.
  • To hide Y based on X, use model.X or model?.X
field.parent.<N>.parent.model?.<property_name>

Use the field.parent.<N>.parent.model?.<property_name> when the properties are object or array.

{
  "X": "", 
  "Y": {
    "Z": ""
  }
}
  • To hide Y (object itself), use field.parent.model?.X.
  • To hide Z based on X, use field.parent.parent.model?.X.
{
  "X": "", 
  "Y": [
    {
      "Z": ""
    }
  ]
}
  • To hide Y (array object) based on X, use field.parent.model?.X
  • To hide Z based on X, use field.parent.parent.parent.model?.X
field.parent.<N>.parent.model?.<root_names>?.<property_name>
{
  "A": {
    "B": ""
  }, 
  "X": {
    "Y": ""
  }
}        
  • Use the field.parent.<N>.parent.model?.<root_names>?.<property_name> when the properties have different root object.
  • To hide Y based on B, use field.parent.parent.model?.A?.B

Info

parent.<N>.parent - Parent repeated N times as per JSON structure

Schema Configuration

Attributes

Attribute Value Description
hideExpression boolean If the value evaluates to true, the property is not shown in the UI.

Where

Applicable Data Types

  • string
  • integer
  • number
  • array
  • object
  • boolean

Usage

Schema
{
  "<Property_Name>": {
    "type": "string",
    "dxFormProperties": {
      "hideExpression": "<expression that evaluates to a boolean value>"
    }
  }  
}

Warning

The expression works across a definition only. Plugin developers will not be able to use properties from multiple definitions as defined in schemas. For example, a property from linkedSourceDefinition can not be used in snapshotDefinition.

Examples

Examples
Expression Description
!model.userName Returns true if the userName property is EMPTY.
model.booleanFlag Returns true or false based on the booleanFlag property
model.backupType === 'PRIMARY' Returns true if the backupType property is PRIMARY.
model.backupType !== 'PRIMARY' && !model.userName Return true if backupType property is not PRIMARY and userName property is EMPTY.

password is a string property which will be shown in the UI if userName is present and not empty.

{
  "userName": {
    "type": "string"
  },
  "password": {
    "type": "string",
    "dxFormProperties": {
      "hideExpression": "!model.userName"
    }
  }
}
Common Root

password is a string property which will be shown in the UI if userName is present and not empty.

{
  "userDetails": {
    "type": "object",
    "properties": {
      "userName": {
        "type": "string"
      }
    }
  },
  "securityDetails": {
    "type": "object",
    "properties": {
      "password": {
        "type": "string",
        "dxFormProperties": {
          "hideExpression": "!field.parent.parent.model?.userDetails?.userName"
        }
      }
    }
  }
}
Different Root