> For the complete documentation index, see [llms.txt](https://docs.gridmate.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gridmate.io/package-reference/components-library/dynamic-components/gm-grid-interaction-subscriber.md).

# GM - Grid Interaction Subscriber

(gmpkg:dataGridInteractionSubscriberLWC)

## **Documentation**

**GM - Grid Interaction Subscriber** component is an invisible bridge that turns GridMate grid interactions into Lightning App Builder events. It listens to the interactions published by a grid on the same page and, when the **Object Name**, **DataGrid Name** and **DataGrid Code** match the source grid, fires the corresponding event. In the App Builder, you can then use the **Event** tab of the subscriber to update other components on the page, for instance by mapping `{!Event.recordId}` to their **recordId** property.

{% hint style="info" %}
The source grid must have the **Enable Dynamic Interactions** option checked to publish its interactions.
{% endhint %}

The subscriber matches the grid using the following values:

<table data-full-width="true"><thead><tr><th width="244">Grid</th><th width="281.6414794921875">DataGrid Name</th><th width="330.50341796875">DataGrid Code</th></tr></thead><tbody><tr><td><a href="https://docs.gridmate.io/package-reference/components-library/grids/gm-user-grid.md">GM - User Grid</a></td><td>The User Grid developer name</td><td>The User Grid developer name</td></tr><tr><td><a href="https://docs.gridmate.io/package-reference/components-library/grids/gm-fieldset-grid.md">GM - FieldSet Grid</a></td><td>The <strong>Field Set</strong> name</td><td>The <strong>DataGrid Code</strong> of the grid</td></tr><tr><td><a href="https://docs.gridmate.io/package-reference/components-library/grids/gm-listview-grid.md">GM - ListView Grid</a></td><td>The <strong>ListView Name</strong></td><td>The <strong>DataGrid Code</strong> of the grid</td></tr><tr><td><a href="https://docs.gridmate.io/package-reference/components-library/grids/gm-relatedlist-grid.md">GM - RelatedList Grid</a></td><td>The related list name</td><td>The <strong>DataGrid Code</strong> of the grid</td></tr></tbody></table>

**Use case:** Display a grid of accounts with dynamic interactions enabled and refresh the related grids of the page with the account clicked by the user. See [User Grid - Dynamic Interactions](https://docs.gridmate.io/advanced-guides/user-grid/user-grid-dynamic-interactions.md) and [Grid Dynamic Interaction](https://docs.gridmate.io/advanced-guides/dynamic-components/grid-dynamic-interaction.md).

## **Specification**

<table data-full-width="true"><thead><tr><th width="244">Property</th><th width="131.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>Object Name</td><td>String</td><td>The API name of the object displayed by the source grid. Ex. Account.</td></tr><tr><td>DataGrid Name *</td><td>String</td><td>The name of the source grid. See the table above. The subscriber stays inactive while this property is empty.</td></tr><tr><td>DataGrid Code</td><td>String</td><td>The code of the source grid. See the table above. Leave it empty only if the source grid has no code.</td></tr></tbody></table>

## **API Reference**

{% tabs fullWidth="true" %}
{% tab title="dataGridInteractionSubscriberLWC.js-meta.xml" %}

```xml
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>65.0</apiVersion>
    <isExposed>true</isExposed>
    <masterLabel>GM - Grid Interaction Subscriber</masterLabel>
    <description>GM - Grid Interaction Subscriber</description>
    <targets>
        <target>lightning__AppPage</target>
    </targets>
    <targetConfigs>
        <targetConfig targets="lightning__AppPage">
            <property name="objectName" type="String" label="Object Name" description="DataGrid Object Name" />
            <property name="gridName" type="String" label="DataGrid Name" description="DataGrid Name" />
            <property name="gridCode" type="String" label="DataGrid Code" description="DataGrid Code" />

            <event name="rowclicked" label="Row Clicked" description="Fired when an a row is clicked">
                <schema>
                    { "type": "object", "properties": { "recordId": { "type": "string", "title": "Record Id",
                    "description": "Record Id" } } }
                </schema>
            </event>
            <event name="reloaditems" label="Reload Items" description="Fired when a reload of the grid is requested">
                <schema>
                    { "type": "object", "properties": { "recordId": { "type": "string", "title": "Record Id",
                    "description": "Record Id" } } }
                </schema>
            </event>
        </targetConfig>
    </targetConfigs>
</LightningComponentBundle>
```

{% endtab %}
{% endtabs %}

## Events

<table data-full-width="true"><thead><tr><th width="244">Event</th><th width="131.33333333333331">Payload</th><th>Description</th></tr></thead><tbody><tr><td>Row Clicked (<code>rowclicked</code>)</td><td><code>recordId</code></td><td>Fired when a row of the source grid is clicked. <code>{!Event.recordId}</code> is the Id of the clicked record.</td></tr><tr><td>Reload Items (<code>reloaditems</code>)</td><td><code>recordId</code></td><td>Fired when a reload of the grid is requested.</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gridmate.io/package-reference/components-library/dynamic-components/gm-grid-interaction-subscriber.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
