# How to Pass Multiple Selected Records from a Dynamic Component to a Screen Flow

## Overview

Learn to send a collection of records (e.g., rows selected in a Data Table) from your Avonni Dynamic Component into a Screen Flow launched via "Open Flow Dialog" or "Open Flow Panel." This guide covers setting up the Flow's input collection variable and mapping the selection in the interaction

***

## Prerequies&#x20;

{% hint style="danger" %}

## **Important Prerequisite: Configure Flow Input Collection Variable**

Before proceeding, ensure the Screen Flow you intend to launch has a **Collection Variable** configured to receive the selected records. In the Flow Builder, this variable *must* have "**Allow multiple values (collection)**" and "**Available for Input**" checked. (A `Text` data type is commonly used for passing record IDs). This setup is required so you can map the selected records to this variable in the interaction settings
{% endhint %}

***

## Guided Steps: Passing Selected Records to a Flow

{% stepper %}
{% step %}

### Prepare Your Data Display Component

* **Ensure Multi-Select is Enabled:** Select the component where users will choose multiple records (e.g., your Avonni **Data Table**). In its Properties Panel, ensure the setting allowing **multiple row selection** is enabled.
* **Note the API Name:** Confirm the **API Name** of this Data Table (e.g., `OpportunityTable`), as you'll need it in Step 4
  {% endstep %}

{% step %}

### Create the Trigger Action Element

* Add the component users will click to start the process. This is usually an **Avonni Button** placed near your data component, or a **Header Action** configured directly within the Data Table's header properties.
* Give this button/action a clear **Label** (e.g., "Process Selected Opportunities", "Update Statuses")

<figure><img src="/files/Sfb1p0CCU4xqcN0aHorS" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add the "Open Flow Dialog/Panel" Interaction

* Select the Button or Header Action you created in Step 2.
* In the Properties Panel, go to the **Interactions** section.
* Choose the event to trigger the Flow (typically **On Click**).
* Click **Add Action**.
* Set the **Action Type** to either **`Open Flow Dialog`** or **`Open Flow Panel`**.
* In the **Flow API Name** setting, select the specific **Screen Flow** you prepared earlier (the one containing the input collection variable – see Prerequisite section).

<figure><img src="/files/SIQ2dOG07aPA2FCROiqF" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Map Selected Records to the Flow's Input Variable

This is crucial in connecting the Data Table's selection to the Flow. Within the configuration settings for the **"Open Flow Dialog/Panel"** action you just added:

1. Find the **Input Variables** section.
2. Click the "Add Item" button to create a mapping.
3. **Input Name:** From the dropdown list, select the **API Name** of the **Collection Variable** you created inside your Screen Flow (marked as 'Available for Input' in the prerequisite step).
4. **Value:** Click the **resource selector icon** next to the value field.
   * Choose **Component Attribute**.
   * Select your **Data Table** component (using its API Name, e.g., `OpportunityTable`).
   * Choose the attribute that holds the selected row data:
     * **`selectedRowsKeyValue`**: Use this if your Flow's input collection variable is of type `Text` and you want to pass **only the record IDs**. This is the most frequent use case.
       {% endstep %}
       {% endstepper %}

<figure><img src="/files/HMIPEKyJ0GPN4ozEMCvS" alt=""><figcaption></figcaption></figure>

***

## **Troubleshooting Common Issues**

* **Flow Doesn’t Launch:** Verify the **Flow API Name** matches an existing Screen Flow with the input collection variable configured. Check user permissions to access the Flow.
* **No Records Passed:** Ensure multi-select is enabled on the Data Table and rows are selected before triggering the action. Confirm the selectedRowsKeyValue attribute is mapped correctly.
* **Error on Mapping:** Ensure the Flow’s input Collection Variable API Name matches the **Input Name** in the interaction. Mismatched names or types (e.g., Text vs. Record) cause errors.
* **Outdated Package Version:** If the interaction fails, you might be using an obsolete version of the Avonni Components package. [**Update to the latest version**](broken://spaces/JU6zQrEzmfEcUVL9Ocs7/pages/uZ38UYo60uxBHFsBJhjY) to ensure compatibility with this feature.
* **Performance Lag:** Large record selections may slow the Flow. Limit the Data Table’s row count or use filters to reduce data volume.
* **Other Issues:** If you encounter persistent problems, please reach out to us at [**support\_dc@avonni.app**](mailto:support_dc@avonni.app)


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.avonnicomponents.com/dynamic-components/tutorials/interactions/flow-integration/how-to-pass-multiple-selected-records-from-a-dynamic-component-to-a-screen-flow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
