More about codelists

<< Click to Display Table of Contents >>

Administration > Menu reference > Administration > Codelists > Codelist manager >

More about codelists

Codelist - a table connected to a drop down menu

In dpSpatial, it is common for the attribute form to have predefined (but optional) values. This means that the program automatically sets values from the start. These values are then presented in dropdown menus and can be changed if desired. Different objects have individual predefined values in their attribute forms.

The values in the dropdown menus are defined by the user in what are known as codelists. A codelist is a table with code values that are connected to a dropdown menu, where they correspond to attribute values. The attribute values are visible in plain text in the dropdown menu.

A codelist consists of at least two fields: Value (CODENUM) and code text (CODETEXT).

There are several benefits using codelists. The codelist simplify searches in the data base since it is smoother to search for numbers instead of text strings. This means that an attribute can have long text strings without affecting the search time. By using the code lists predefined values, the risk of inconsistent or invalid attributes being used on objects decrease. Inconsistent or invalid attributes may cause lower quality on the information in the data base.

Display and change code listed values

There are several options to show information in the attribute form regarding the code list behind a drop down menu. With the administration rights you may also start the code list manager and edit the content in the drop down menu straight from an attribute form.

 

 

Show all codelist values

Select Show all codelist values to open a new window showing all codelist values for the selected option in the drop down menu.

Open the codelist manager

Select Open the codelist manager to edit the codelist in the codelist manager. Note, this option is only available for users with administrator rights in the system.

View codelist documents

Select View codelist documents to view documents that has been attached to the code list manager. If no document is attached, the no document found window will open instead.

 

 

The codelist construction

 

Code lists may vary in looks. The minimum requirement is two fields, one key field and one text field. The key field that is containing code list value is called CODENUM by default. The name CODENUM explained by the fact that most code lists have integer as key values. The text field (attribute field) is called CODETEXT by default. It is optional to rename the fields. Note, the key field must be unique.

 

Below you will find a presentation of two different code lists types. Note, as a user of this system you may edit and in other ways work with already existing code lists, but the system is not built to help users create their own code lists. Do not hesitate to contact your customer manager at Digpro if any furhter questions regarding creating new code lists.

 

Code list types

 

Subtype dependent code list value

There are cases where the code listed value is dependent of the objects suptype. One example is Conductor type that exist in both low and high voltage. To be able to handle subtype dependent        values, it is required that the code list contains the DP-SUBTYPE field.

 

Linked code lists

A way to organize code list values is to allow multiple fields in a code list to match the users own multiple-choice lists in the attribute form. That way it is possible to create a dynamic filtering of optional alternatives, and where the users choice in a multiple-choice list decide the selection of options in the next multiple-choice list.

A linked codelist as the one described above may look as follows:

Codenum

Manufacturer

Material

Dimension

0

ABB

Plastic

10

1

ABB

Plastic

20

2

ABB

Plastic

30

3

ABB

Plastic

40

4

ABB

Plastic

50

5

ABB

Plastic

60

6

ABB

Steel

20

7

ABB

Steel

30

8

ABB

Steel

70

9

ABB

Steel

80

10

ABB

Copper

20

11

ABB

Copper

30

12

ABB

Copper

90

 

 

 

100

Ericsson

Plastic

10

101

Ericsson

Plastic

20

102

Ericsson

Plastic

30

 

 

 

120

Ericsson

Plastic

110

121

Ericsson

Plastic

120

122

Ericsson

Steel

20

123

Ericsson

Steel

90

124

Ericsson

Paper

20

 

In the example above, the attribute form would contain the three drop down menus "Manufacturer", "Material" and "Dimension". If the user select ABB as manufacturer, the material list will display the material types that are defined for ABB. The same way the options "20", "30" and "90" displays in the dimension list if the user in the next step select "Copper" in the material list.

As before, it is only the code value that will be saved for the object. If further dimensions are requested for ABB:s copper cables, you add a new row in the code list with the field values Code value/ABB/Copper/New dimension