# Rule

Rules allow you to apply visual formatting and interactive behavior to grid data based on user-defined conditions. With **Rule**, you can highlight values, hide data, restrict editing access, and provide contextual cues — all directly from within the grid interface.

Rules are currently available for **Grid view** only. Matrix grids are not supported.

***

## Setup a Rule

To create a rule:

1. Click the **Rule** button in the toolbar.
2. Click the **Add Rule** button.
3. Enter a **Rule Name**.
4. Define your condition(s) and apply condition logic in the **When** section.
   * Condition logic (AND/OR) is applicable when you add two or more conditions.
5. Choose the formatting or behavior in the **Then** section.
6. Optionally, add a **Legend** to help users understand the rule’s purpose.
7. Click **Apply** to create the rule.
8. Click **Apply** again to activate and apply the rule to the grid.

<figure><img src="/files/bWRNpBM3fXys4upjSr2c" alt=""><figcaption><p>Rule Setup</p></figcaption></figure>

***

## Conditions (When Section)

The **When** section defines the logic for when a rule should apply. You can create one or more conditions using supported fields and operators.

### **Supported Logic**

* **AND logic**: All conditions must be true
* **OR logic**: At least one condition must be true
* **Nested logic supported**: For example, `(Condition A AND Condition B) OR Condition C`
* **Note**: You cannot use both **AND** and **OR** at the same level — for example, `Condition A AND Condition B OR Condition C` is **not supported** unless properly nested.

### **Example Conditions**

* `Additional Discount > 20`
* `Final Amount < 1000`
* `Scheduled Date < Today`

Blank cells are excluded from logic evaluations. Zero (0) is treated as a valid numeric value.

***

## Actions (Then Section)

The **Then** section defines what happens when the condition(s) are met. Each rule supports one or more actions, depending on the selected columns or rows.

<table><thead><tr><th width="187">Action Type</th><th width="206">Applies To</th><th>Description</th></tr></thead><tbody><tr><td><strong>Cell Format</strong></td><td>Specific columns</td><td>Make a cell Read Only or Hidden</td></tr><tr><td><strong>Cell Highlight</strong></td><td>Specific columns</td><td>Apply visual highlight (Dot/Bar/Fill)</td></tr><tr><td><strong>Row Read Only</strong></td><td>Entire row</td><td>Makes the row non-editable</td></tr><tr><td><strong>Row Highlight</strong></td><td>Entire row</td><td>Applies background fill to the row</td></tr><tr><td><strong>Row Action*</strong></td><td>Row Action</td><td>Make the Row Action button hidden</td></tr></tbody></table>

* \*Only applicable for Wave Embedded.

***

## Legends

Legends provide users with a clear explanation of why a cell or row is formatted. When a legend is configured:

* A **Legend icon** appears in the toolbar
* Clicking the icon displays a list of all configured legend messages.
* Each message is limited to **50 characters**.
* Legends are displayed visually based on the Rule’s action type — such as **bar**, **dot**, **fill**, or **read-only formatting**.

<figure><img src="/files/JUYBGHYsmB7H4dtOEY3U" alt=""><figcaption><p>Legend</p></figcaption></figure>

***

## Advanced Rule Features

### **Rule Reordering**

* Drag the number to reorder rules
* Numbers will auto-update
* New order is saved instantly

<figure><img src="/files/1QjZ68rKOvagS8DmcNPI" alt=""><figcaption><p>Rule Reordering</p></figcaption></figure>

### **Overlapping Rules**

* If multiple rules apply to the same field **Format** (Read Only, Hidden) takes precedence over **Highlight.**

<figure><img src="/files/G2QST8pnQfodEQc3n7qA" alt=""><figcaption><p>Overlapping Rules</p></figcaption></figure>

### **Rule Cleanup**

* If a field tied to a rule is removed from the grid:
  * A confirmation dialog will appear
  * Users can choose whether to delete the rule or cancel the field removal

<figure><img src="/files/JuBm76NHUhEMqP4Sm0cd" alt=""><figcaption><p>Rule Cleanup</p></figcaption></figure>

***

## Limitations

* **Rules work only in Grid view** – They are not available for Matrix grids.
* **Nested logic is limited** – Within a single condition group, you can’t mix AND and OR without nesting.

## Known Issue

**Issue**: Using **‘is any of’** or **‘is none of’** conditions on **Date** or **DateTime** fields in **Rules** may cause Wave to freeze or crash after a short time.

**Workaround**:\
Reload Wave and remove the Date/DateTime field from the Rule configuration.

> ℹ️ **Recommendation**: Avoid using these conditions on Date/DateTime fields in Rules until this issue is resolved in a future release.


---

# 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.valorx.com/valorx-wave/wave-data-management/managing-grid-data/rule.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.
