Question
We're looking to create some custom fields and would like to know the differences between the various Data types.
Answer
There are multiple data types that enable administrators to create metadata schemas that can range from simple to very complex.
String - The most frequently used data type for Custom Fields. Typically used for when a single value Custom Field is required. For example, creating a Data Classification field to inform users about the type of data that they're working with.
In this Custom Field definition, a Min items value of 2 was defined which means that at least two of the five available values must be set.
When a user edits the metadata on content, the schema will look like this:
Because the option for Categorization was enabled, when users search for content, and this piece of content is part of the search results, the facet will allow for each value to be used as a filter, not the union of the three.
Number - Similar to the Text data type, but used for numerical values, including decimals. One use case would be the ability to score content based on certain criteria. The number data type also allows users to leverage a slider control, which requires a minimum and maximum value to be set.
Otherwise, values can be hardcoded, or users can be allowed to enter any value that require. In the UI, when setting the metadata value for a slider enabled number data type, the UI looks like this:
Once the value is set, it appears like this for users.
In the UI, when setting the metadata value for an array of numbers data type, with a range specified, the UI looks like this:
Example of when there aren't enough values set to meet the Custom Field requirements.
When a number does not match the specified range (13 and -7 would be both be outside the desired range).
Integer - Identical to the Number data type, except that the Integer data type only supports whole numbers and thus does not provide a precision setting.
Array of Integers - Identical to the Array of Numbers data type, except that the Array of Integers data type only supports whole numbers and thus does not provide a precision setting.
Boolean - Another popular data type used when a Custom Field meets a certain requirement. When a Boolean data type is selected for a Custom Field, then the user will have a tri-state checkbox available to them.
The default state, which means that the field is not set:
The selected state, which means that the value is yes:
The unselected state, which means that the value is no:
A very common use for this data type is for indicating whether content has been certified or not. Here is a Custom Field definition for this type of usage.
When setting the metadata value for this Custom Field, this what the user would see:
Value hasn't been set yet.
Value has been set to Yes.
Value has been set.
Date - The Date data type is ideal for specifying a single date. This could be used to indicate when the content was first made available, when it becomes 'de-classified' or public, or when there is an expiry date on the lifespan of the object.
Like most data types, ranges are supported. Here is an example of a date Custom Field that only allows users to set expiry dates from January 1, 2024 through December 31, 2025. The format of the date value can also be configured.
In the UI, when setting the metadata value for a date data type, with a range specified, the UI looks like this:
Custom Field value not set:
Clicking on the control and browsing to a date that is lower than the minimum date specified in the Custom Field definition (notice the values are greyed out):
A date value being selected:
Custom Field with a date value specified: