Previous Topic: ca_pam_createSelectStore(nameArray, valueArray)Next Topic: Text Field


ca_pam_createSelectStoreFromSQLResult(resultFromSQLQuery, nameColumnID, valueColumnID)

Creates a set of options for a Select field directly from the result of an SQL query.

Input Parameters
resultFromSQLQuery (object)

Defines the data retrieved by a SQL statement.

nameColumnID (array)

Defines the name of the column in the SQL result that is used as names in the Select field.

valueColumnID (array)

Optionally defines the name of the column in the SQL result that is used as values in the Select field. If omitted, the column that is defined by nameColumnID is used for both names and values.

Return Value

The array that the function builds is returned.

Example

This example uses the result of a query of an external data source to set the options for the City field. The query runs when the user selects an option from the Region field.

ca_pam_addValuesInSelectStore('Form1.City',ca_pam_createSelectStoreFromSQLResult(result,'txtRegion'));

You can also find this function in the out-of-the-box content in CA Process Automation.

  1. On the Home page, click Browse Out-of-the-Box Content.
  2. Navigate to the User Interaction Forms folder, then 06 Populate Dropdown DB: Populate Dropdown from DB.