sections in the article
CVL stands for Controlled Vocabulary List. This article explains what CVLs are, how they can be used to give you full control over all possible values that appear in a Field, and how to define them in Control Center.
What is a CVL?
CVL is a data type and an Elastic data model concept that presents the user with a predetermined list of values to choose from. This gives you full control over all possible values that can appear in a Field, forcing the users to select one or more predetermined values, avoiding the risk of getting unwanted or misspelled values.
This constraining works by associating a Field type with a predefined list of values in the Elastic data model.
Creating CVLs in Control Center
Before you start changing the CVL table, make sure to discuss the best way forward with your inriver partner. This helps avoid accidents.
There are two parts to creating a full CVL:
- Create the CVL in Control Center
- Add individual CVL values
After that is done, you also need to assign the CVL to a Field type in order for it to be used inside inriver.
Creating a CVL
To create, edit, or delete CVLs, navigate to Control Center > Model > CVL by clicking on the CVL column. This takes you to the list of all available CVLs.
In Control Center > Model > CVL
do the following:
- Click AddCVL
A new row is added to the CVL table.
- Fill in the available fields on the new row:
(click on each field to expand)Id
The unique name of the CVL. The identifier must follow the rules for CVL IDs.
Write a short descriptive text. Make sure it is unique.
CVL IDs have the following restrictions:
Maximum length is 31 characters.
Allowed character set: A to Z, a to z, 0 to 9
The identifier cannot start with a digit
Characters such as spaces, underscores, hyphens, etc. cannot be used
See Restrictions on Identifiers for more information on identifier restrictions.Once created, you cannot edit the unique name of a CVL. You can only delete and recreate the CVL.
DataType
Selects the type of data. Options are
String
for lists with single language-independent values andLocaleString
for lists with language-dependent values, requiring translation and different values for different languages. See Adding individual CVL values, for more information.Parent Id
The name of the parent CVL, if available. If there is no parent CVL, use the blank space at the top of the list; otherwise, select the name from the Parent Id drop-down list.
When a CVL has a parent, all its values are connected to one value in the parent CVL. The parent CVL holds the main group categories, while the child CVL holds the subgroup categories. By associating each subgroup category with one and only one main group category, you can make sure you enter the correct value for a sub-group.
A parent CVL cannot be a multivalue CVL.
Custom Value List
Sets whether the CVL is a custom CVL. If you want your new CVL to be a custom CVL, tick the box on the Custom Value List field; otherwise, leave it blank. This field is used for those special types of CVLs, called custom CVLs, created and controlled by a special kind of Server Extensions implementing the ICustomValueList interface. All standard CVLs have this field blank.
Activated
Sets whether the CVL is activated or not. If you want your new CVL to be activated, tick the box on the Activated field; otherwise, leave it blank. If left blank, this value will not be included in the CVL list in inriver portal. You can toggle the view to show only active CVLs in the system.
- Click Save when you are done.
The table of CVLs is saved with your new CVL row.
Now that your new CVL is created, you can proceed with adding individual values to it.
Adding individual CVL values
Clicking on a specific CVL takes you to Control Center > Model > CVL > CVL Values, which shows you its values.
In Control Center > Model > CVL > CV Values, for the CVL you want to add values to
do the following:
- Click Add CVL Value
A new row is added in the CVL Values for {yourCVLname} table.
Alternatively, if you are editing an existing CVL, you can click on Edit on an existing value row to change it.
- Fill in the available fields on the new row:
(click on each field to expand)Key
The unique key for the CVL value. The key must follow the rules for CVL keys.
Maximum length 64 characters
Allowed character set, including space*: A to Z, a to z, 0 to 9, and - _ : ! ( ) # ? @ % = . ^
The following characters are not allowed: ' & / | ; , " <> ± *+\
The identifier can start with a digit.
Spaces should not be used for the first or last character of a CVL key.
See Restrictions on Identifiers for more information on key and other identifier restrictions.Index
Sets the order by which the values appear in a drop-down list inside the inriver portal. Defaults to 0. You can return later to edit the order of the values.
Deactivated
Sets whether the CVL value is activated or not in the CVL. Keep empty to make sure the value is activated on your CVL.
Value/{language}
The displayed value of the specific entry. Instead of Value, CVLs with
LocaleString
datatype have {language1}, {language2}, {language3}, etc., to accommodate the multiple language values.
- Click Save when you are done.
The new CVL value gets added to your CVL.
The server setting MAX_NUMBER_OF_INLINE_CVL_VALUES
determines whether a CVL is shown as a drop-down list or as radio buttons. This setting applies to all parent CVLs in the system. Child CVL values only appear as a dropdown menu. See Server settings in Control Center for more information.
Assigning the CVL to a Field
After creating a CVL, you must assign it to a Field type. While setting up the assignment to Field, you get the following CVL-related options:
-
Data Type
This parameter needs to be set to CVL.
-
Multivalue
Setting the multivalue flag on a Field that is defined as having a CVL data type allows users to select several values at once for this Field. This is represented as a semicolon-separated list of CVL keys.
Multivalue-CVL refers to a property of a Field type, not a property of a CVL.
A multivalue-CVL cannot be a parent-CVL.
-
Default Expression
Use this parameter to define a default value that is shown for a Field with a CVL data type.
If you want to programmatically add several values to a Field type in multivalue mode, you can add a semicolon-separated list of keys in the Default Expression parameter. See Multivalue-CVLs.
For more information on the Field type creation process see How to add a FieldType in Control Center's Model and all its properties explained.
Best practices when managing CVLs
- If you want to delete CVL values, you should search all Entities that use the value set, and mass update them to change that value. After the CVL value has been dissociated from all Entities, you can proceed to delete it.
- If your String CVL has more than 500 values, you should consider if the Field should be set up as a LocaleString instead.
- Utilize parent/child CVLs by grouping values in large CVLs under a parent value. A CVL's purpose is to control data and make enrichment easier. When the CVLs are too large, they can be difficult to use in different contexts.
Further reading
Adding values to a CVL (one language)
What are CVLs and what is their business value
Comments
0 comments
Please sign in to leave a comment.