> For the complete documentation index, see [llms.txt](https://docs.b2ihealthcare.com/snow-owl-authoring-platform/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.b2ihealthcare.com/snow-owl-authoring-platform/local-code-systems/authoring/creating-local-code-systems/property-validation.md).

# 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.*

![String type property validation](https://snowowl.atlassian.net/wiki/download/thumbnails/1198358541/06.png?version=1\&modificationDate=1602684589372\&cacheVersion=1\&api=v2\&width=750)

### Editing property definitions

Existing property definitions can be modified using the Local Code System editor. This is also where new properties can be added using the![](/files/nMWlkR40lPQU8g5YbctV)button, and existing ones can be removed using the ![](/files/hkygNGFbAzqzqZ9NnFgw)button. To persist the changes, press save.&#x20;

<figure><img src="/files/wILqNr0PKcbhp8ELatTW" alt=""><figcaption><p>Schema change warning</p></figcaption></figure>

{% hint style="warning" %}
Schema changes will not automatically update concepts.&#x20;
{% endhint %}

To keep concepts in sync, save the editor and then press the dedicated![](/files/cKOfUcCj8sr3mAJ24QDi)*Update Concept Properties* button in the Additional Properties section toolbar. Newly added properties will also be available on the concepts, while deleted properties will be removed from the concepts.

User-defined properties in the Local Code editor are presented in the order of the corresponding property definitions configured on the Local Code System editor. The order of the definitions can be rearranged using the arrow buttons located on the property definition section headers. The detailed definition of a property can be collapsed and expanded individually or by pressing the![](/files/WPavEh3JiDj1SAbK9XEa)button in the section toolbar.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.b2ihealthcare.com/snow-owl-authoring-platform/local-code-systems/authoring/creating-local-code-systems/property-validation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
