Help:Data Dictionary:Value Lists

From Opadeez Wiki
Jump to navigationJump to search

The Value Lists page is used to create list of values that can be associated with attributes. For example you may create a list of values for "Gender" with values: Male, Female etc... Value lists can be static, in which case the values are defined in the "Value list entries" section of this page. Or, if a "Table name" is defined, the list of values are fetch from a database table.

Value Lists

Value list name Name of the Value List. This name must be unique.
Table name (optional) If provided, the values of the Value list will be taken from this database table instead of the "Value list entries" definition. This database table is expected to have the following fields:
  • Value: the value of the option
  • Description: the text to be displayed for the option
  • DependencyValue: the dependency value
Save value lists Save changes to the value lists. When creating a new value list, this save is required to be able to use the value list for an Attribute. Alternatively you can use the "Save all" action button to save all changes made to the solution.

Value list entries

Value Value of the Value List option. This value will be stored in database when the option is selected. Values must be unique.
Text Text displayed in the user interface for this option.
Dependency value Dependency value allows creating dependency between 2 attributes having different value lists. There is no limit to the number of attributes linked together with a dependency.

For example in order to create a Country / State / City dependency, proceed as follows:

  • Create a "Country" value list, where values are country codes (e.g. USA, AUS...) and Text are country names (e.g. U.S.A, Australia...)
  • Create a "State" value list, where values are state codes, dependency values are associated country code and Text are state names. In this example state codes must be unique across all countries, so it is a good idea to prefix the state code with the country code. For example:
    • Value: USA_NV, Text: Nevada, Dependency Value: USA
    • Value: USA_ON, Text: Ontario, Dependency Value: USA
    • Value: USA_LA, Text: Louisiana, Dependency Value: USA
    • ...
    • Value: AUS_NT, Text: Northern Territory, Dependency Value: AUS
    • Value: AUS_SA, Text: South Australia, Dependency Value: AUS
    • Value: AUS_VIC, Text: Victoria, Dependency Value: AUS
    • ...

Create a "City" value list, where values are city codes, dependency values are associated state code and Text are city names. In order to ensure city codes are unique across all countries, it is a good idea to prefix **them with the country/state code. For example:

    • Value: USA_NV_CarsonCity, Text: Carson City, Dependency Value: NV
    • Value: USA_NV_LasVegas, Text: Las Vegas, Dependency Value: NV
    • Value: USA_LA_BatonRouge, Text: Baton Rouge, Dependency Value: LA
    • Value: USA_LA_LakeCharles, Text: Lake Charles, Dependency Value: LA
    • ...

Then you can use these value lists by creating 3 attributes (Refer to Entities Attributes for details) as follows:

  • Country
    • Type: String length 2 (will store the country codes)
    • Value list: Country
    • Value list dependency: <blank>
  • State
    • Type: String length 6 (will store the state codes)
    • Value list: State
    • Value list dependency: Country (this refers to the Country attribute created above)
  • City
    • Type: String length 50 (will store the city codes)
    • Value list: City
    • Value list dependency: State (this refers to the State attribute created above)

See also