> 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 change how grid data looks or behaves when it meets conditions you set. Use them to highlight important values, hide data, or lock cells from editing, so users can spot what matters at a glance.

Rules work in both **Grid** and **Matrix**. Matrix has a few extra behaviors, covered in [Rules in Matrix](#rules-in-matrix).

## How a Rule Works <a href="#how-a-rule-works" id="how-a-rule-works"></a>

Every rule has two parts:

* **When**: the condition(s) a record must meet.
* **Then**: what happens to the cell, column, or row when the condition is met.

**Example:** *When* Amount is greater than 10,000, *then* highlight the cell in pink.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2F7HsCwp3E1L64mhM3QIl8%2FRule%20Highlight%20Amount%20greater%201000.gif?alt=media&amp;token=ca59dd77-7687-41eb-9bb4-bff017e21097" alt=""><figcaption><p>When Amount > 10,000 → Then highlight the cell.</p></figcaption></figure>

***

## Create a Rule

{% stepper %}
{% step %}

#### Open the Rule panel.&#x20;

Click Rule in the toolbar, then click Add Rule.
{% endstep %}

{% step %}

#### Name the rule.&#x20;

Enter a Rule Name that describes its purpose, for example Higher Order Value.
{% endstep %}

{% step %}

#### Set the When (Condition).&#x20;

Select a column, an operator, and a value. Click + Add to add more conditions. See [When (Condition)](#conditions-when).
{% endstep %}

{% step %}

#### Choose the Then (action).&#x20;

{% hint style="info" %}
The available options in the **Then** section depend on the fields selected in the **When** section.
{% endhint %}

Select what happens when the condition is met. Click + Add to add more actions. See [Then (action)](#actions-then).
{% endstep %}

{% step %}

#### Add a legend (optional).&#x20;

Click the Legend (L) icon next to the action, enter a short message, then click ✓. See [Legends](#legends).
{% endstep %}

{% step %}

#### Save and apply.&#x20;

Click Apply to save the rule. Then click Apply again to save all rules and apply them to the grid.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FsUxMaldSkJTonagbG3DU%2FHigh%20Order%20Value%20Grid%20v2.gif?alt=media&amp;token=24db639a-c465-47c9-8c56-75986f68c1ac" alt=""><figcaption><p>Create a Rule</p></figcaption></figure>
{% endstep %}
{% endstepper %}

***

## Conditions (When)

Each condition compares a column against a value. For example:

* `Final Amount > 5000`
* `Quantity ≥ 50`
* `Scheduled Date < Today`

#### Combine conditions <a href="#combine-conditions" id="combine-conditions"></a>

When a rule has two or more conditions, choose how they combine:

<table><thead><tr><th width="132.33331298828125">Logic</th><th width="304.55548095703125">The rule applies when…</th></tr></thead><tbody><tr><td><strong>AND</strong></td><td>All conditions are true</td></tr><tr><td><strong>OR</strong></td><td>At least one condition is true</td></tr></tbody></table>

To mix AND and OR, group the conditions, for example `(A AND B) OR C`. Mixing them at the same level, such as `A AND B OR C`, is not supported.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FKNoL85tKqAyo51rUQA1B%2Fimage.png?alt=media&amp;token=16ce36b6-98d1-4e99-a221-212621463ac6" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Blank cells are ignored when conditions are checked. Zero (0) counts as a value.
{% endhint %}

***

## Then (Actions) <a href="#actions-then" id="actions-then"></a>

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FIQ2tMAOQfM84XNlOmyrs%2Fimage.png?alt=media&amp;token=d2b0abcb-7b70-4cab-946d-5cb5a0307646" alt=""><figcaption><p>Then (action) in Grid</p></figcaption></figure>

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FnVdR90zqCtIgVV8czJMU%2Fimage.png?alt=media&amp;token=287ecceb-924c-44d4-afb2-940ecfb0e9ea" alt=""><figcaption><p>Then (action) in Matrix</p></figcaption></figure>

<table data-search="false"><thead><tr><th width="156">Action Type</th><th width="158">Applies To</th><th width="312">Description</th><th>Available In</th></tr></thead><tbody><tr><td>Cell Format</td><td>Specific columns</td><td>Make a cell Read Only or Hidden</td><td>Grid, Matrix</td></tr><tr><td>Cell Highlight</td><td>Specific columns</td><td>Apply visual highlight (Dot/Bar/Fill)</td><td>Grid, Matrix</td></tr><tr><td>Column (X-Axis) Format</td><td>X-Axis column</td><td>Make the column Read Only or Hidden. This applies to all data cells under that X-axis column</td><td>Matrix only</td></tr><tr><td>Column (X-Axis) Highlight</td><td>X-Axis column</td><td>Apply visual highlight (Bar/Dot/Fill) to all data cells under that X-axis column</td><td>Matrix only</td></tr><tr><td>Row Read Only</td><td>Entire row</td><td>Makes the row non-editable</td><td>Grid, Matrix</td></tr><tr><td>Row Highlight</td><td>Entire row</td><td>Applies background fill to the row</td><td>Grid, Matrix</td></tr><tr><td>Row Action</td><td>Row Action</td><td>Make the Row Action button hidden</td><td>Grid (Wave Embedded only)</td></tr></tbody></table>

### The Highlight Style <a href="#choose-a-highlight-style" id="choose-a-highlight-style"></a>

Highlight actions (Cell, Row, and Column Highlight) let you pick a style and a color.

1. Click the style dropdown next to the action.
2. Under **Style**, select **Bar**, **Dot**, or **Fill**.
3. Select a color. For **Fill**, select a color, then choose a shade.

<table><thead><tr><th width="112.3333740234375">Style</th><th width="394.555419921875">What it looks like</th></tr></thead><tbody><tr><td><strong>Bar</strong></td><td>A colored bar along the cell</td></tr><tr><td><strong>Dot</strong></td><td>A colored dot in the cell</td></tr><tr><td><strong>Fill</strong></td><td>The cell or row background filled with color</td></tr></tbody></table>

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FzTLPD7VJJl0HLTvR0Iks%2FChoose%20The%20Highlight%20Style.gif?alt=media&amp;token=3153d31e-26aa-4b72-aa2f-60714adcaf2f" alt=""><figcaption><p>The Highlight Style</p></figcaption></figure>

### The Format Option <a href="#choose-a-format-option" id="choose-a-format-option"></a>

Format actions (Cell Format and Column (X-Axis) Format) control whether cells can be edited or seen.

1. For **Cell Format**, select the column to format.
2. Select **Read Only** or **Hidden**.
3. For **Read Only**, click the style swatch next to it and choose a shade from **Gray**, **Cool Gray**, or **Warm Gray**.

<table><thead><tr><th width="146.77777099609375">Option</th><th width="478.99993896484375">Result</th></tr></thead><tbody><tr><td><strong>Read Only</strong></td><td>Cells can't be edited and are shaded in the gray you choose</td></tr><tr><td><strong>Hidden</strong></td><td>Cell values are hidden. No style is needed</td></tr></tbody></table>

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2Fn5qI03FHwqpY31oAaRfu%2FChoose%20A%20Format%20Option.gif?alt=media&amp;token=d0179192-1c1f-4a45-984f-1f93aa516e88" alt=""><figcaption><p>The Format Option</p></figcaption></figure>

### When Rules Overlap <a href="#when-rules-overlap" id="when-rules-overlap"></a>

If more than one rule affects the same cell:

1. **Format** (Read Only, Hidden) takes priority over **Highlight**.
2. Between rules of the same type, the rule higher in the list takes priority.
3. To change priority, drag a rule's number to move it. Numbers update automatically, and the new order saves instantly.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FKluzwwO72UotQHVhcvUF%2FWhen%20Rules%20Overlap.gif?alt=media&amp;token=05318932-1c69-4b5f-953e-cb22bf0caabe" alt=""><figcaption><p>When Rules Overlap</p></figcaption></figure>

***

## Legend <a href="#legends" id="legends"></a>

A legend is a short message that tells users what an action means, for example *High Order*. Each legend can be up to **50 characters**.

To add one, click the **Legend** (L) icon next to an action in the Then section, enter your message, and click ✓. If a rule has more than one action, each action can have its own legend.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FbDD7Q8ascq2b7ircBKYM%2FLegend%20v2.gif?alt=media&amp;token=416d08d6-8e5d-45dd-a12c-a7385e0c8abc" alt=""><figcaption><p>Legend</p></figcaption></figure>

Each action appears as its own entry in the [Filter by Color](#filter-by-color) panel, labeled with its legend. If no legend is set, the entry shows the rule name. For cell actions, it also shows the column name, for example Account Rating */ Account Name*.

***

## Color Bar <a href="#color-bar" id="color-bar"></a>

Color Bar gives every value in a column its own color. It's a quick way to color-code a field like Lead Source or Account Type without writing a rule for each value.

### Apply a Color Bar <a href="#apply-a-color-bar" id="apply-a-color-bar"></a>

1. Click **Rule** in the toolbar, then click **Color Bar**.
2. Select a column from the **Column** dropdown, for example *Lead Source*.
3. Click **Apply**.

The rule shows as **Color Bar applied**. The number next to it shows how many distinct values were found, and each value gets a default color.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2Fvv8rN8suJfNOoKlOFGTG%2FColor%20Bar.gif?alt=media&amp;token=284bcc2f-4927-4b2f-af88-ffb5be088219" alt=""><figcaption></figcaption></figure>

### Customize colors <a href="#customize-colors" id="customize-colors"></a>

1. Click the **Edit** (pencil) icon next to the Color Bar rule.
2. Choose a color for each value, or select **No Fill** to leave it unformatted.
3. Click **OK**, then click **Apply**.

To go back to the default colors, click **Reset to default colors**. To close without saving, click **X**.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FTmZCyvPX4fmSJrvTQZvk%2FCustomize%20colors.gif?alt=media&amp;token=15beb9cb-f77c-488e-abe0-37f8b37323f7" alt=""><figcaption><p>Customize colors</p></figcaption></figure>

***

## Manage Rules <a href="#manage-rules" id="manage-rules"></a>

### Delete a Rule <a href="#delete-a-rule" id="delete-a-rule"></a>

Click the **Delete** (trash) icon next to the rule, then click **Apply**.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FKKrXDFoequhHGzZiQhzT%2FDelete%20a%20rule.gif?alt=media&amp;token=5a169684-7887-488c-a7fb-4c35233d685f" alt=""><figcaption><p>Delete a Rule</p></figcaption></figure>

### Remove a Field Used by a Rule <a href="#remove-a-field-used-by-a-rule" id="remove-a-field-used-by-a-rule"></a>

If you remove a field from the grid that a rule depends on, a confirmation appears. Choose to delete the rule along with the field, 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%2FdxPgh7GLAp13dQcmoXib%2FRemove%20a%20Field%20Used%20by%20a%20Rule.gif?alt=media&amp;token=2983a1b3-db33-45f3-8a28-f064ae878585" alt=""><figcaption><p>Remove a Field Used by a Rule</p></figcaption></figure>

***

## Filter by Color <a href="#filter-by-color" id="filter-by-color"></a>

Filter by Color shows only the rows that match the rules you select. The panel lists each rule action with its style and its legend.

1. Click the **Filter by Color** icon in the toolbar.
2. Select the rules you want to filter by. Rows matching **any** selected rule are shown.
3. To see rows that don't match any rule, turn on **No Fill**.
4. To show all rows again, clear your selections.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FuM1Xnb7LTusrkyqrh9VC%2FFilter%20by%20Color.gif?alt=media&amp;token=86a03feb-f065-45e6-884b-ea24ad829921" alt=""><figcaption><p>Filter by Color</p></figcaption></figure>

> **Note:** Filter by Color works together with field filters, so rows must match both. If you delete a rule that's being used as a filter, that filter is cleared and its hidden rows return. Other active filters stay as they are.

***

## Rules in Matrix <a href="#rules-in-matrix" id="rules-in-matrix"></a>

Rules in Matrix use the same setup as Grid, with the differences below.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FdNIZngL4yIOaTAqeuXXT%2FRules%20in%20Matrix.gif?alt=media&amp;token=ec1390c4-f254-4ba7-a9c7-291f41d8943b" alt=""><figcaption><p>Rules in Matrix</p></figcaption></figure>

### Columns are Grouped by Axis <a href="#columns-are-grouped-by-axis" id="columns-are-grouped-by-axis"></a>

In the When section, the Column dropdown groups fields into **Y-Axis**, **X-Axis**, and **Data** fields.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FeHOxU5fXYRPaQCOBYRaZ%2Fimage.png?alt=media&amp;token=537994f7-602c-4484-a0f8-650b2b1020ec" alt=""><figcaption><p>Column Selection for Matrix</p></figcaption></figure>

### Available Actions Depend On The Axis <a href="#available-actions-depend-on-the-axis" id="available-actions-depend-on-the-axis"></a>

The axis of the field(s) in your condition decides which actions you can choose:

<table><thead><tr><th width="267.888916015625">Condition uses…</th><th>Available actions</th></tr></thead><tbody><tr><td>Y-Axis field</td><td>Cell Format and Cell Highlight (Y-axis and Data cells), Row Read Only, Row Highlight</td></tr><tr><td>X-Axis field</td><td>Cell Format and Cell Highlight (Data cells), Column (X-Axis) Format, Column (X-Axis) Highlight</td></tr><tr><td>Data field</td><td>Cell Format and Cell Highlight (Data cells)</td></tr><tr><td>Y-Axis + Data, or X-Axis + Data</td><td>Cell Format and Cell Highlight (Data cells)</td></tr><tr><td>Y-Axis + X-Axis (with or without Data)</td><td>Not supported</td></tr></tbody></table>

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FkKtHRXDN9m8Zj02VPLcG%2FAvailable%20ACtion%20for%20Y%20-%20Axis.gif?alt=media&amp;token=2d95b431-6d92-4bc7-9bf1-ef34f0c38eaa" alt=""><figcaption><p>Available Actions On The Y-Axis</p></figcaption></figure>

### Rules Check The Displayed Value <a href="#rules-check-the-displayed-value" id="rules-check-the-displayed-value"></a>

* Rules are applied to the value shown in the matrix cell.
* A cell shows **\[Multiple]** when its values can't be aggregated. Rules are not applied to that cell.
* When **Multiple Currency** is enabled in your org, currency values can be aggregated. Rules still apply to those cells, even when they show \[Multiple].

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FzSUmcqwefk4rk7uyzJpk%2FRules%20Check%20The%20Displayed%20Value.gif?alt=media&amp;token=2440d6e3-b95c-43cf-b29a-7ff351c198b1" alt=""><figcaption><p>Rules Check The Displayed Value</p></figcaption></figure>

#### Filter by Color <a href="#filter-by-color-1" id="filter-by-color-1"></a>

In Matrix, Filter by Color works on **Y-axis** rules only. It is not available for X-axis or Data columns.

<figure><img src="https://2237973035-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F65f4C4H8V5e0YV342mwp%2Fuploads%2FW9XUnAkBvMDzreo942ky%2FFilter%20by%20Color%20Matrix.gif?alt=media&amp;token=a70b419d-12ef-4425-8802-768201f2824e" alt=""><figcaption></figcaption></figure>
