> For the complete documentation index, see [llms.txt](https://docs.valorx.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valorx.com/valorx-wave/wave-data-management/managing-grid-data/rule.md).

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

## Filter by Color

Filter by Color allows users to filter grid rows based on Rules. It is accessible from the Toolbar.

{% hint style="info" %}
Note: **Matrix Filter by Color** is supported on the **Y-axis only**; it is not available for Data or X-axis columns.
{% endhint %}

<figure><img src="/files/ODrd9wdxt2BRqyOhR21M" alt=""><figcaption></figcaption></figure>

### Filter by Color Icon

When the Rules button is visible in the toolbar, clicking the **Filter by Color** icon the list of all configured rules that have a legend label and style assigned.

* Each entry displays a style swatch and the legend label.
* Toggle one or more rules on to filter the grid to rows matching those rules.
* Multiple active toggles use **OR logic** — rows matching any active rule are shown.
* A badge on the L icon shows the number of active filters.
* **Select All** resets all toggles and restores all rows.

### Filter Logic

<table><thead><tr><th width="472">Scenario</th><th>Logic</th></tr></thead><tbody><tr><td>Multiple rules within the same entry point</td><td>OR</td></tr><tr><td>Toolbar and column header filters both active</td><td>AND</td></tr><tr><td>Rule-based and field-based filters both active</td><td>AND</td></tr></tbody></table>

Each entry point is cleared independently.

### Rule Deletion Behavior

If a rule is deleted while a filter referencing it is active:

* The rule is removed from the Filter Color surfaces
* Any active filter referencing the deleted rule is automatically cleared.
* Rows hidden solely by that rule are restored.
* All other active filters remain unaffected.
