Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

Specifying a data source directly in a property

Updated on February 7, 2022

Make the development process more convenient by defining the source of data for a control directly in a property that populates the control with values at run time. For example, you can configure a drop-down menu to display the contract type property.

Apply this configuration to picker controls, which include the following controls:
  • Autocomplete field
  • Multiselect list
  • Check box
  • Drop-down menu
  • Radio button
  • Slider
  • Anypicker control
The UI Gallery landing page contains working examples of the controls. For more information, see Accessing the UI Gallery.
Before you begin: Prepare the data source configuration:
  1. In the navigation pane of Dev Studio, click Records.

  2. Expand the Data Model category, and then click Property.

  3. In the list of available properties, select and open the property that you want to edit.

  4. In the Edit Property configuration form of your property, on the General tab, edit the Data access section that displays options based on the property mode.

  5. For all the property modes, except for Page and PageList, select one of the following options:

    ChoicesActions
    Users provide data manually at run timeSelect Manual.

    Note: Data transforms and other rules might be required to support this workflow. For more information, see Configuring a data transform.
    Property retrieves data via a linked property,

    A linked property is a special form of property that holds the value of a key to an operator ID, organization, access group, or other data object that presents data from that object anywhere in the system

    1. Select Automatic reference to class instance (linked).

    2. In the Linked Class field, select a class that contains the linked property.

    3. In the Linked Mapping section, in the Source Property field, select the linked property name.

      Result: The keys for the linked class appear. If the class contains only one key, the value of your property becomes the key that is used to open the object at run time. If the class contains more than one key, the source properties become input fields where you can enter values for the keys or properties that provide the appropriate values at run time.
  6. For the Page and PageList property modes, select one of the following options:

    ChoicesActions
    Users provide data manually at run timeSelect Manual.
    Property refers to a data page (the property values are refreshed every time the data page is refreshed)
    1. Select Refer to a data page.

    2. For PageList mode, to retrieve each embedded page in the PageList separately, select the Load each page in this page list individually check box.

    3. In the Data Page field, enter a data page that stores values to refer.

    Property copies data from a data page (the property values are not refreshed when the data page is refreshed)
    1. Select Copy data from a data page.

    2. For PageList mode, to retrieve each embedded page in the PageList separately, select the Load each page in this page list individually check box.

    3. In the Data Page field, enter a data page that stores values to copy.

    4. To copy only selected information from the data page, in the Optional Data Mapping field, enter a data transform that determines what information the system copies.

  7. In the Display and validate section, in the UI control list, select a picker control to display the values of the property at run time.

  8. To configure a custom control with parameters, such as the pxOperatorImage custom control, select the Parameters link that is displayed below the UI control list.

    Note: Out-of-the-box autogenerated controls do not have parameters.
  9. In the Table type field, restrict the value that a property can have at run time by completing one of the following settings:

    ChoicesActions
    No values populate in the property fieldSelect None.

    For example,you can choose that setting when you want to use the property with a Text input control.

    The property value is limited to a small number of values in a single language
    1. Select Local list.

    2. In the Table values section, manually add the set of acceptable values to display or enter in the picker control at run time.

      For example: You can enter explicit values for contract types, such as permanent, contract, intern.
    Note: If you enter a value in the first row, the input appears at run time as a default value, which users might overlook. To encourage users to make a deliberate selection at run time, leave the first entry blank. To require users to make an explicit choice, leave the first row entry and mark the corresponding field on a user form as required.
    The set of valid values contains more than a few hundred values or the values are expected to change frequently, and the values are available at run time within the keys of field value rules
    1. Select Field value.

    2. In the Field Value description section, in the Class list, select a class that is the first key part (Applies To class) of one or more field value rules.

      The class that is specified here need not match the Applies To key part of this property.
    3. In the Field name list, enter the second key, which is the FieldName parameter of the field values that have the specified class as their first key part.

      For example: In the @baseclass pyCaption StatementCopy field value, which is the field value for the string Statement copy, the first key part of the field value rules is the @baseclass class name (the Applies To class for these rules). The second key part is pyCaption (the FieldName parameter for these rules).
    The set of acceptable values is defined by using the keys of a particular class (other than the Applies To class of the property)
    1. Select Class Key Value.

    2. In the Table description section, in the Validation class list, select a concrete class that stores the set of acceptable values.

    1. If the validation class has more than one key, in the Subset name field, enter the value of the key in the validation class that represents the subset that contains the list of acceptable values.

      For example: If the Data-CustomerTerritory class has a state code and county name as keys, then, to restrict values for a property at run time to county names in the New York state, enter Data-CustomerTerritory as the validation class and NY as the subset name.

      For more information, see Class keys.

    The set of valid values contains more than a few hundred values or the values are expected to change frequently, and the values are available at run time as the keys of a certain known class
    1. Select Remote list.

    2. In the Class of instance list, select a class of the instance.

    3. In the Reference to list or group list, select a property that has one of the List or Group modes, that is: value list, value group, page list, or page group.

    4. If you select a Page list or Page group property in the Reference to list or group, in the Reference in each to scalar property list, identify a property that contains the value that is an index that identifies the specific page that contains the list.

    5. Leave the Reference to localized value field blank.

    6. In the Keys of instance section, add a key by clicking the Add a row icon.

    7. In the Key field field, enter the name of the property that is a key of the class.

    8. In the Value field, enter the value for the key of the instance.

    Note: When you select the remote list table validation, the set of acceptable values consists of the elements of a Page List or Page Group within a single object.

    Table validation through a class key value specifies a class against which the input values are validated, while table validation through a remote list specifies a particular instance of a class against which the values are validated.

    The actual values that are stored in the clipboard are different from the values presented to the user at run time

    1. Select Prompt list.

    2. In the Prompt values section, add a prompt by clicking the Add a row icon.

    3. In the Standard value field, enter a value.

      The system stores this value internally as the property value.
    4. In the Prompt value field, specify the value that is visible in the UI at run time.

      For example: When the standard value specifies a short value like EDate, the corresponding prompt value can be a more human-readable value like Date to complete this task. The standard value is the value that is stored on the clipboard, and the prompt value is the value that is displayed to the user at run time.
    Note:

    This feature supports localization. The Localization wizard localizes the values that is specified in the Prompt value field. The wizard creates the appropriate field value rules for the prompt value entries, and then uses those field value rules to hold the translated text.

    The set of acceptable values is defined in a data page
    1. Select Data page.

    2. In the Class of instance list, select the class of the data page instance.

    3. In the Data page list, select a data page.

    4. In the Property for value list, select the values to be the source for the property values.

    5. In the Property for display text list, select the value that you want to display as the label for the property values.

  10. If the selected table type is field value, data page, class key value, remote list, or prompt list, decide whether to use the property values for display only, or for display and validation:

    • To specify that you can use the values only for display and for localization, select the Display only (not for validation) check box.
    • To specify that you can use the values not only for display and localization, but also for validation, clear the Display only (not for validation) check box.
    For example: For an autocomplete control with values that are sourced from a local list, which is also enabled for a free-form input, if a user enters a value that is not in the list and the Display only (not for validation) check box is cleared, the system returns an error message. If the check box is selected, the system does not validate the values that are entered and does not return an error message.
  11. In the property form, click Save.

Have a question? Get answers now.

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

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us