LinkedIn
Copied!

Phone control in DX API

The Phone control (pxPhone) helps users enter valid phone numbers in forms. Learn about the JSON structure and elements of a sample Phone control, to understand how you can integrate it into your custom application.

The following JSON code is a sample API response for the Phone control:

{
  "validationMessages": "",
  "visible": true,
  "labelReserveSpace": true,
  "readOnly": false,
  "control": {
    "modes": [
      {
        "modeType": "editable",
        "controlFormat": "Standard",
        "textAlign": "Left",
        "tooltip": "User's contact info",
        "maxChars": "13",
        "placeholder": "Enter a valid phone number.",
        "formatType": "tel",
        "specifySize": "auto",
        "minChars": "10"
      },
      {
        "modeType": "readOnly",
        "controlFormat": "Standard",
        "tooltip": "",
        "showReadOnlyValidation": "false",
        "formatType": "tel",
        "obfuscated": false
      }
    ],
    "actionSets": [],
    "type": "pxPhone"
  },
  "label": "Enter phone no",
  "type": "Text",
  "required": true,
  "validateAs": "",
  "reference": "phone",
  "labelFormat": "Standard",
  "disabled": false,
  "testID": "202008250326390088456",
  "value": "+0000000000000",
  "maxLength": 0,
  "expectedLength": "",
  "fieldID": "phone",
  "customAttributes": {
    "testAttr": "testVal"
  }

 

The following examples show a sample configuration of the control with the relevant JSON elements:

Cell properties - General tab
Cell properties - General tab
  • When rules that are part of conditions, such as Visibility or Disable, return boolean values.
  • Fields, such as Helper text or Default value, return the corresponding value from the associated Pega rules.
  • For conditions, such as Visibility or Disable, only the Always and Condition (when rule) options are supported.
  • For conditions, such as Visibility or Disable, for the Condition (when rule) option, negation with the logical operator (!) is supported. For example, !pzVisibleWhen.
DX API attributes
DX API attributes
The response returns the name-value pairs that you add to the DX API attributes of the control as part of the customAttributes element.
Cell properties - Presentation tab
Cell properties - Presentation tab
Property referenced in the control - Advanced tab
Property referenced in the control - Advanced tab
The message in the validationMessages element is displayed when the validation in the validateAs element fails.
Suggest Edit
Did you find this content helpful?

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.