Property Validation
Property values entered are validated against their type. Optional validation expressions need to be specified in JavaScript where the property value is referred as _this.value
. The expressions need to be evaluated to a boolean value (true|false
). Examples:
Only uppercase values are valid for strings:
_this.value == _this.value.toUpperCase()
Only numbers larger than 10 are valid:
_this.value > 10
Date value needs to be after 2016-12-04 12:45:30:
_this.value.isAfter(java.time.LocalDateTime.parse(\"2016-12-04T12:45:30\")
Valid email string:
/\S+@\S+/.test("_this.value")
In case the validation fails for the value entered in the Local Code Editor, the defined validation message is presented to the user. The value entered can be referenced using the %s
specifier. For example, typing the value MyString
for a string type Local Code property where the property definition's validation expression and message are
_this.value == _this.value.toUpperCase()
Only upper case letters are allowed. '%s' has lowercase letters
,
will result in the message Only upper case letters are allowed. 'MyString' has lowercase letters.
Editing property definitions
Schema changes will not automatically update concepts.