Previous Topic: ca_pam_selectOptionByIndex(_id, index, isSelect)Next Topic: ca_pam_clearSelectStore(_id)


ca_pam_addValuesInSelectStore(_id, values)

Adds new options to the Select field with a simple set of values that you define in code.

Input Parameters
_id (string)

Specifies the unique identifier of a Select field.

values (Javascript object)

Specifies an array of objects where each object has two properties ("name" and "value") that are necessary to represent the Select field options. The "name" property for each object is represented as the key for the option added and "value" property would be the value. If you have an array of names and values, then you could also use the ca_pam_createSelectStore function to create the "values" object (as shown in the example).

Return Value

None.

Example

This example uses the user selection of West or North in a separate Region field to update icons available in the City field dynamically.

if('West'==regionChoice)
  var cityOptionNames =["New York","Rio De Janeiro","Mexico City"]
    var cityOptionValues =["West_01","West_02","West_03"];
if('North'==regionChoice)
  var cityOptionNames =["Madrid","Moscow","Copenhagen"]
    var cityOptionValues =["North_04","North_05","North_06"];
ca_pam_addValuesInSelectStore('Form1.City', ca_pam_createSelectStore(cityOptionNames ,cityOptionValues ))

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. The function can be found in the following forms:
    • 04 Populate Dropdown Dataset: Populate Dropdown Dataset.
    • 06 Populate Dropdown DB: Populate Dropdown from DB.