Populating Drop-Down Lists with Query Results

You can populate drop-down lists with the results of a query that you define. You use Java Persistence Query Language (JPQL) or SQL commands to write the query to search for values that are stored in instance data.

For example, you can create a City Name characteristic as a drop-down list populated with all Place entities created from the City specification.

The JPQL query for this data is as follows:

Select name from GeographicPlace where specification.name.contains(“City")

You can also populate a drop-down list with the results of pre-defined query that returns all authorized UIM users.

To populate a drop-down list from the results of a query:

  1. From the Studio menu, select Show Design Perspective.

  2. Click the Dictionary tab.

  3. Select the data element that you want to tag as a characteristic.

    The Data Element tab appears in the Data Schema editor.

  4. Click the Settings tab.

  5. In the Control Type field, ensure that DropDown is selected.

  6. Click the Characteristics tab.

  7. In the Drop Down Options field, select Query.

  8. In the Data Source field, select JPQL, SQL or USERS.

  9. (Optional) If you selected JPQL or SQL, do one of the following:

    • In the Parameters field, select one or more characteristics.

    • In the Body field, enter a query to use in a filtered data query. When you use a filtered data query, you must include a question mark(?) in the query string a to indicate where in the query the characteristic parameter is to be used.

  10. From the File menu, select Save.