Add a Drop-down list to a table column

Use the drop-down list to change the content of a row in a table with multiple rows.

You can add a drop-down list for a table column in both normal and capture forms.

You can populate a drop-down list using dynamic data, lookup or static values. You can also populate a drop-down list by configuring an action (such as .NET method, Web service or DB query) on events such as "Clicked", "Text changed", and more.

For Capture forms, at runtime, all rows for the target table column are updated to use the new choice list. Any existing values in that table column will remain. You must use a business validation rule to invalidate the existing values if any when you update a table column choice list.

The following example shows a list of digital camera products. Each digital camera has more than one free add-on associated with it. After the user selects a camera, they can select the free add-on from the related drop-down list.

To use a drop-down list, store the information in a previously defined database, .NET method, or Web service call.

For example, when creating a Staff

Location Details table, enter the location details for each Staff member. Office location details appear in the Location table of the database. Map the Location column of the Staff Location Details table to the Location table of the database.

At runtime, when you add a row to the Staff Location Details table and enter location, the drop-down list is populated with the contents of the Location table. You can then select the location for a specific staff person.

For example, if Bryan Walsh works in the London office, select London from the Location list.

  1. Add columns to a table.
  2. On the Data type list, select String.
  3. On the Type list, select Drop-down.
  4. On the Display mode list, select either Text or Value and text.
    For Value and text, additionally provide Text width% and Value width%.
  5. On the Data source list, select one of the following options:
    • Dynamic: To use dynamic data in a drop-down list in a table column, create or select a .NET method, Web service, or DB query action.

      Important The used action should return array type parameter. Assign the Table to the return array parameter. Select the <TableName.TableColumn.Text> and <TableName.TableColumn.Value> properties in the required array columns.

    • Lookup: To use a predefined lookup, click Lookup and select the lookup to use. See Manage a lookup.

    • Static: To use a static value, do the following:

      1. Click .

      2. Enter a Name and Value that appears on the drop-down list at runtime. For example, Please select.

      3. Click Add.

        The item is added to the list. Create as many items as required.

      4. To make the item as default, on the list of items, select Default for the item. This item populates the field by default at runtime. For example, for a Title list, add the static items, such as Mr., Mrs., Miss, and select Mrs as the default.

      5. To reorder the list, use . By default, the drop-down list items appear in the order in which they are defined.

    Note You can dynamically populate the drop-down list for capture table cell of a choice type. However, for forms prior to 7.6.0, the default value set in the static data source is applied even if the dynamic data source is configured. You must regenerate the forms to allow dynamic population of data.
  6. Click Save.