> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/pass-the-record-id-to-a-flow-opened-in-a-panel.md).

# Pass the record Id to a flow opened in a panel

Open a second screen flow in a side panel from an Avonni Data Table row, and pass that row's record Id into the panel flow's recordId variable.

An agent on an Account sees its Contacts in an Avonni Data Table and clicks **View** on one row. A side panel opens a second flow that shows that Contact. Salesforce only fills `recordId` for the flow on the page: the flow in the panel gets its Id from the Open Flow Panel interaction, through an input variable you set.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FgNiGuA9mnPmT5xIeNvzQ%2Frecordid-pass-the-record-id-to-a-flow-opened-in-a-panel-result.png?alt=media" alt="Avonni Data Table of an Account&#x27;s Contacts in a screen flow, with an Open Flow Panel showing the clicked Contact&#x27;s details, the row&#x27;s record Id passed to the panel flow&#x27;s recordId"><figcaption><p>Click View: the panel flow receives that Contact's Id.</p></figcaption></figure>

## Before you start

* A screen flow with an Avonni [Data Table](https://docs.avonnicomponents.com/flow/flow-components/data-table.md) listing the Account's Contacts. [Filter a Data Table or Map by the current record](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/filter-a-data-table-or-map-by-the-current-record.md) builds one.
* A row action on that table, for example **View**. See [Creating row actions](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/creating-row-actions.md).

## Steps

{% stepper %}
{% step %}

### Build the flow that opens in the panel

Create a second screen flow, `Contact Details`:

* A Text variable `recordId`, with **Available for input** checked.
* A screen with an Avonni [Record Detail](https://docs.avonnicomponents.com/flow/flow-components/record-detail.md) whose **Record ID** is `{!recordId}`, or a Get Records on Contact with `Id` Equals `{!recordId}`.

Save and activate it.
{% endstep %}

{% step %}

### Add a Row Action interaction

Back in the first flow, open the Data Table in the **Component Builder** and go to the **Interactions** tab. Under **Row Action**, add an interaction, set **Target Name** to your **View** action and choose **Open Flow Panel**.
{% endstep %}

{% step %}

### Pick the panel flow

In **API Name**, search for and select `Contact Details`. Set a **Header**, for example `Contact`, and a **Size**.
{% endstep %}

{% step %}

### Pass the row's Id

Under **Input Variables**, click **Add Item**:

* **Name**: `recordId`. The list shows the input variables of the panel flow.
* **Value**: **Record: Id**, the Id of the row that was clicked.
* **Type**: **Text**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FmVOQmNGf1WuCIXE4a1iD%2Frecordid-pass-the-record-id-to-a-flow-opened-in-a-panel-input-variables.png?alt=media" alt="Open Flow Panel interaction in the Avonni Component Builder for a screen flow: input variable recordId with Value Record: Id, the Id of the clicked Data Table row, type Text" width="320"><figcaption><p>Input Variables: recordId takes the row's Id.</p></figcaption></figure>

To pass the page's record instead of the row (from a header action, for example), set **Value** to the first flow's own `recordId`.
{% endstep %}

{% step %}

### Save and test

Save and activate the first flow, open an Account and click **View** on a Contact. The panel opens beside the table and shows that Contact. Click **View** on another row: the panel shows the new one.
{% endstep %}
{% endstepper %}

To send several selected rows at once, use the **Selected Record Ids** value instead: [Passing multiple record IDs to another flow](https://docs.avonnicomponents.com/flow/tutorials/components/data-table/tips-and-tricks/passing-multiple-record-ids-to-another-flow.md). Every other panel option (position, backdrop, output variables, On Finish) is in [How to setup an Open Flow Panel interaction](https://docs.avonnicomponents.com/flow/tutorials/interactions/how-to-setup-an-open-flow-panel-interaction.md).

## Troubleshooting

<details>

<summary>The Name list is empty</summary>

The panel flow has no input variable. Open `Contact Details`, check **Available for input** on `recordId`, save and activate, then reopen the interaction.

</details>

<details>

<summary>The panel opens with an empty or blank new-record form</summary>

The panel flow received no Id. Check that **Value** is set on the input variable. A Record Detail with an empty **Record ID** switches to create mode, which is why the form looks new.

</details>

## Related tutorials

* [How to pass your current RecordID in your screen flow](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/how-to-pass-your-current-recordid-in-your-screen-flow.md): how the first flow gets its Id.
* [Open Flow Panel](https://docs.avonnicomponents.com/flow/component-builder/interactions-panel/open-flow-panel.md): the interaction reference.
* [Test a screen flow that needs a record Id](https://docs.avonnicomponents.com/flow/tutorials/tips-and-tricks/test-a-screen-flow-that-needs-a-record-id.md): Debug the panel flow on its own with a Contact Id.


---

# 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.avonnicomponents.com/flow/tutorials/tips-and-tricks/pass-the-record-id-to-a-flow-opened-in-a-panel.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.
