Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

OMF with PI Web API

Nullability

  • Last UpdatedSep 04, 2025
  • 1 minute read

You can define properties of type messages to accept null values. The nullability of a property is determined by the following rules:

  • For static types, only String properties are nullable.

  • For dynamic types, all property types are nullable.

  • For dynamic types, a null value is translated to No Data.

  • Properties that use IsIndex or IsName are not nullable.

You define a property as nullable by specifying an array of accepted values including the type and null. The type and null may appear in any order in the array. The following is an example of a property that is not nullable:


"properties": [
"Address": {
"type": "string"
}
]

Here is the same property defined as nullable:


"properties": [
"Address": {
"type": [ "string", "null" ]
}
]

Note: The default value for a String property that is not nullable is "". This is in contrast to the default value for String properties defined in the OMF specification, which is null.

The following are additional examples of properties defined as nullable:


"properties": [
"Widgetness": {
"type": [ "number", "null" ],
"format": "float32"
}
"Widgetness": {
"type": [ "null", "integer" ],
"format": "int32"
}
]

TitleResults for “How to create a CRG?”Also Available in