# 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="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FXtcaHM9hUm4N1ALTQ6MB%2FRule%20v3.gif?alt=media&#x26;token=f91beb66-b527-4021-b360-01345a425194" 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="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FWAsEYeJJ07VO0xk5sUY3%2FLegend.gif?alt=media&#x26;token=d7849bc6-3ff1-4cc9-881c-3edb2af4046c" 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="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FQTyo841x6ISMWTabibvL%2FReorder%20Rules.gif?alt=media&#x26;token=0323c97b-492c-4672-ba86-369f07b56bb2" 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="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FgGms1zBB83sJnKiGmMNp%2FOverlapping%20Rules.gif?alt=media&#x26;token=e74448ae-b736-4a17-beb1-f5464c721c04" 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="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FD9rAcgC4iHx85wMwyKSN%2FRule%20Cleanup.gif?alt=media&#x26;token=ca1aaeb2-806a-4439-bfe7-79176eb21382" 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.
