LinkedIn
Copied!

Table of Contents

Autocomplete control in DX API

The Autocomplete control (pxAutoComplete) helps users conveniently enter appropriate values by suggesting matches from a drop-down list when the user starts typing. Learn about the JSON structure and elements of a sample Autocomplete control, to understand how you can integrate it into your custom application.

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

{
    "validationMessages": "",
    "visible": true,
    "labelReserveSpace": true,
    "readOnly": false,
    "control": {
        "modes": [
            {
                "groupOrder": "asc",
                "displayFullScreen": true,
                "tooltip": "",
                "enableGrouping": true,
                "groupBy": "",
                "minChars": "",
                "minSearch": "",
                "dataPageValue": "pyID",
                "maxResults": "",
                "loadMode": "auto",
                "options": [
                  {
                    "value": "",
                    "key": "N-7001"
                  },
                  {
                    "value": "",
                    "key": "N-7002"
                  },
                  {
                    "value": "",
                    "key": "N-8004"
                  },
                  {
                    "value": "",
                    "key": "N-8006"
                  },
                  {
                    "value": "",
                    "key": "N-8007"
                  },
                  {
                    "value": "",
                    "key": "N-8008"
                  },
                  {
                    "value": "",
                    "key": "N-9001"
                  },
                  {
                    "value": "",
                    "key": "N-11001"
                  },
                  {
                    "value": "",
                    "key": "N-11002"
                  },
                  {
                    "value": "",
                    "key": "N-11003"
                  },
                  {
                    "value": "",
                    "key": "N-15001"
                  },
                  {
                    "value": "",
                    "key": "N-15002"
                  },
                  {
                    "value": "",
                    "key": "N-17001"
                  },
                  {
                    "value": "",
                    "key": "N-17002"
                  },
                  {
                    "value": "",
                    "key": "N-17003"
                  }
                ],
                "dataPageID": "D_Cases",
                "maxChars": "",
                "formatType": "text",
                "obfuscated": false,
                "dataPagePrompt": "pyCreatorID",
                "allowFreeFormInput": true,
                "displayAsComboBox": false,
                "listSource": "datapage",
                "textAlign": "Left",
                "dataPageParams": [],
                "modeType": "editable",
                "lightWeightAutoComplete": false,
                "controlFormat": "",
                "dataPageTooltip": "pyEffortActual",
                "specifySize": "auto"
              },
            {
                "modeType": "readOnly",
                "autoPrepend": "",
                "tooltip": "",
                "showReadOnlyValidation": "false",
                "autoAppend": "",
                "formatType": "text",
                "obfuscated": false
            }
        ],
        "actionSets": [],
        "type": "pxAutoComplete"
    },
    "label": "Autocomplete",
    "type": "Text",
    "required": false,
    "validateAs": "",
    "reference": "pyTemplateAutoComplete",
    "labelFormat": "Standard",
    "disabled": false,
    "testID": "202008131029460573631",
    "value": "",
    "maxLength": 0,
    "expectedLength": "",
    "fieldID": "pyTemplateAutoComplete"
}

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.
Cell properties continued
Cell properties continued
  • The three properties in the example are part of control.modes[0] as the following key-value pairs:

    Any property beyond the first three is not part of the JSON response.

    • dataPageValue: pyID
    • dataPagePrompt: pyCreatorID
    • dataPageTooltip: pyEffortActual
  • DX API supports all list sources except for report definitions. If the list source is a data page, the following values are included in the response:
    • dataPageID - The ID of the data page. To obtain the values for the list, call the GET/data/{datapageID} endpoint.
    • dataPageValue - The key of the value selected from the list of values in the data page.
    • dataPagePrompt - The visible label of the value selected from the list of values in the data page.

    See the following example of a data page as the list source: "control": { "modes": [{ "dataPagePrompt": "TeamName", "dataPageValue": "TeamName", "listSource": "datapage", "dataPageID": "D_GetTeams" }], "type": "pxAutocomplete" }

Search settings
Search settings
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.
Property referenced in the control - General tab
Property referenced in the control - General 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.
Cell properties - Presentation tab
Cell properties - Presentation tab

The response returns the value of the Edit options field as a boolean readOnly element. The read-only value is part of the value key in the JSON response.

Cell properties - Presentation tab, continued
Cell properties - Presentation tab, continued
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.