Dependent field attribute types

Dependent fields are attributes whose values are constrained by another field.

For example, if you want to have a field that displays all the cities for a selected state, you could make the city field dependent upon the state field. You can make an attribute dependent on another attribute only when you add it to a specific form. That is, when you create a shared attribute, you cannot make it a dependent field when you create it, only within the context of the forms you add it to.

This section presents the city/state example.

First, you need to create the lookup tables for cities and states. Here are the first few rows of these two tables.

The lkup_state table:

state_id (primary key) state_name
1 Massachusetts
2 New York

The lkup_city table:

city_id (primary key) city_name state_id (foreign key pointing to primary key for lkup_state)
1 Boston 1
2 Cambridge 1
3 New York 2
4 Albany 2

Once you have these tables, you create the parent (state) and child (city) attributes.

For the state attribute, use the following values:

Field Value
Database Column state_id
Use values from this database table lkup_state
Key Column state_id
This field depends on the following column Leave this box clear.

For the city attribute, use the following values:

Field Value
Database Column city_id
Use values from this database table lkup_city
Key Column city_id
This field depends on the following column Check this box and select state (the Internal Name you defined for the state attribute).

Note the following:

  • You can have a Multiple-Select - Database attribute be dependent upon a Single-Select - Database attribute, but not the other way around. In the example above, the city field could be a Multiple-Select - Database attribute, but not the state field.
  • You can sort lookup values based on either the text description or the ID for the lookup value.