Enumerated types
- Last UpdatedJun 25, 2026
- 2 minute read
An enumerated common type defines a set of well-known values for use as a value for property on an object within the platform. They are appropriate for properties that can have a small set of distinct values that have unique names and are not objects in their own right (those would be more properly modeled as relationships, instead). Some common examples of enumerated types might include:
-
T-Shirt Sizes (S, M, L, XL)
-
Colors (Red, Blue, Green)
-
Statuses (New, In Progress, Completed)
-
Modes (Ready, Stand By, Warning)
To define an enumerated CommonType, that type must fulfill the following requirements:
-
TypeCode must be Int32Enum.
-
BaseTypeId must be null.
-
The array of RelationshipDefinitions must be empty.
-
The array of PropertyDefinitions must have one or more properties defined.
Each enumerated option (such as each color, size, or status in the set) should be defined as a PropertyDefinition with the following characteristics:
-
Value must be a unique, non-negative integer.
-
TypeCode must be Int32.
-
TypeId must be null.
-
Uom must be null.
Here is an example of one of the system-defined types, EventState, which defines an enumeration that has two possible values, Active and Closed:
{
"Id": "EventState",
"Name": "EventState",
"Description": "Describes the state of an event as to whether it is currently ongoing or not.",
"State": "Active",
"BaseTypeId": null,
"ClassId": null,
"TypeCode": "Int32Enum",
"Tags": [],
"Properties": [
{
"Id": "Active",
"Name": "Active",
"Description": "This event is currently ongoing.",
"State": "Active",
"TypeCode": "Int32",
"TypeId": null,
"IsRequired": false,
"Value": 0,
"Uom": null
},
{
"Id": "Closed",
"Name": "Closed",
"Description": "This event is closed.",
"State": "Active",
"TypeCode": "Int32",
"TypeId": null,
"IsRequired": false,
"Value": 1,
"Uom": null
}
],
"Relationships": []
}
Using an enumerated common type
To define a property as having data of the specified enumerated CommonType, the PropertyDefinition should:
-
Set its TypeCode to one of the enumerated TypeCode values:
-
Int32Enum
-
NullableInt32Enum if it is optional
-
Int32Array if it is a list of values
-
-
Set its TypeId to the ID of the appropriate enumerated type.