> 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-advanced/grid-as-search-and-select.md).

# Grid as Search and Select

Wave Grid isn't limited to editing records inline. The same Grid can act as a selection screen, letting a user browse and choose one or many records to drive something else entirely, in this case, launching one or more Matrix views.

A user needs to review the same set of records two different ways, for example how revenue breaks down month by month, and how it rolls up by quarter for forecasting. Building two separate report views means keeping both in sync every time the record list changes.

Instead, the user uses a Grid as a selection screen. They search for and check off the records they want to analyze, then run the selection into Matrix.

<figure><img src="/files/8O5ywgWUhviR1bxecNGc" alt=""><figcaption><p align="center">Grid used to select one or many records before launching Matrix</p></figcaption></figure>

From there, the user chooses how many Matrix views to launch and how each one is configured. In this case, two:

* **Monthly Revenue Matrix** groups the measures by month, useful for tracking near-term pace
* **Quarterly Forecast Matrix** groups the same measures by quarter, useful for forecasting conversations

<figure><img src="/files/1WeFD68WAT6MyJZPLCk1" alt=""><figcaption><p align="center">Monthly Revenue Matrix and Quarterly Forecast Matrix, both built from the same selected records</p></figcaption></figure>

Because every Matrix view is built from the same selection, the user never re-picks records or reconciles separate lists between views. Select once, then configure as many Matrix views as the analysis needs, each with its own Timeline grouping.

{% hint style="success" %}

### RECOMMENDED

Set this Grid to Read-Only. Since its role here is selection, not editing, a Read-Only Grid keeps users focused on choosing the right records without the risk of accidental edits along the way.
{% endhint %}

This is one of the ways Wave Grid's versatility shows up: beyond bulk editing, it works equally well as a lightweight selection tool feeding other components, like Matrix.

<figure><img src="/files/EikCO0eQP6w1opxCOOhZ" alt=""><figcaption><p>Grid as Search and Select</p></figcaption></figure>

## How This Is Built

{% hint style="info" %}

#### NOTE

The following section is intended for the development or technical team. It covers the Aura component setup used to build this use case.&#x20;
{% endhint %}

This use case is built within a single Aura component, which combines a Grid for selection and one Matrix instance per view.

### Components Used

* **ValorxRapidGrid** — An embeddable grid, configured in Wave, that lists the records to choose from. Its selection is exposed through outputRecords.
* **MatrixRuntime** — Renders a saved Matrix (built in Wave) for the record IDs passed to its recordId attribute. Use one instance per Matrix view.

### Build Steps

1. **Drop the grid in for selection**. \
   Point it at the configured grid and bind its output to an attribute:

```
<valorxwave:ValorxRapidGrid
  gridId="Opportunity::0680b3ad-..."
  outputRecords="{!v.outputRecords}"
  canChangeGrid="false" height="500"/> 
```

2. **Convert the selection into a comma-separated ID string**. \
   When the user confirms their selection, parse outputRecords (a JSON string of selected rows) down to the record IDs the Matrix expects. This requires a custom helper function, for example:

```
var idString = helper.extractIds(
    component.get("v.outputRecords"));
component.set("v.selectedRecordIds", idString); 
```

{% hint style="info" %}

#### NOTE

**extractIds** is not a built-in method. It is custom Apex/JS the development team writes to parse outputRecords into the ID format Matrix expects.
{% endhint %}

3. **Feed the IDs into each Matrix.** \
   Bind the same ID string to every MatrixRuntime instance. Each renders its own saved Matrix definition:

```
<valorxwave:MatrixRuntime
    matrixId="8c689165-..."
    recordId="{!v.selectedRecordIds}"
    height="500"/>
```

## Key attributes

<table><thead><tr><th width="171">Component</th><th width="157">Attribute</th><th>What it does</th></tr></thead><tbody><tr><td>ValorxRapidGrid</td><td>gridId</td><td>The Wave grid to render (Object::UUID)</td></tr><tr><td>ValorxRapidGrid</td><td>outputRecords</td><td>Bound attribute that receives the selected rows</td></tr><tr><td>ValorxRapidGrid</td><td>canChangeGrid</td><td>false locks the grid to the configured one</td></tr><tr><td>MatrixRuntime</td><td>matrixId</td><td>The saved Matrix definition to render</td></tr><tr><td>MatrixRuntime</td><td>recordId</td><td>Comma-separated IDs driving the Matrix</td></tr></tbody></table>

{% hint style="success" %}

#### TIPS

* Render each MatrixRuntime only after IDs are set (guard with aura:if) so it doesn't load empty.
* Multiple Matrix views can share one selection by binding the same ID attribute to each.&#x20;
* Validate that at least one record is selected before running, and surface a message if not.&#x20;
  {% endhint %}
