# Validation

### ![](/files/t9SI1ERtisjPrFDZCqI9)

The first check mark next to the form widget is the validation rule. You can use this item to add a validation to your interaction page. When you add a validation rule you are prompted with the expression editor. Here you add the expression that should be validated. The validation rule overrides the ignore user input and will always be checked when leaving a node through a button exit.&#x20;

<table><thead><tr><th width="268">Property</th><th>Description</th></tr></thead><tbody><tr><td>Validation Rule</td><td>Expression that is checked for true or false when going out of the node with a button exit. This can be changed by selecting the input field or double clicking the expression in the template editor. </td></tr><tr><td>Style context</td><td>The color of the validation message box.</td></tr><tr><td>Show close button</td><td>Toggle the close (X) on or off. The close button is found on the right side of the validation message. (see image below) <br>This option is only visible on 4.2 runtime in staging or live.</td></tr></tbody></table>

<figure><img src="/files/J27B83pfkvjA9ygK5m2k" alt=""><figcaption><p>False validation for every style in the runtime as seen by a user.</p></figcaption></figure>

<figure><img src="/files/kNflbp9o4Xwb6QK3KXeB" alt=""><figcaption><p>Template editor</p></figcaption></figure>

<figure><img src="/files/lKnrqOGCxBT2VLJ5iqKG" alt=""><figcaption><p>Validation expression editor. The validation passes when this expression returns true. Example only lets you go through and leave the page when the subject has a value. When subject does NOT have a value the validation message is shown.</p></figcaption></figure>

{% hint style="info" %}
Check the [Ignore User Input information](/platform/wemmodeler/flowcharts.md#ignore-user-input) on how to prevent validation for a cancel action.
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.wem.io/platform/template-editor/interaction/validation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
