# List

***

## Tutorials

<table><thead><tr><th width="181.37890625">Category</th><th width="130.0234375">Type</th><th>Tutorial</th></tr></thead><tbody><tr><td><strong>📘 Core</strong></td><td>Build</td><td><a href="../tutorials/projects/interactive-contact-list">Create a contact master details list</a></td></tr><tr><td><strong>🖼️ Display</strong></td><td>Build</td><td><a href="../tutorials/components/list/create-a-grid-list-with-images">Create a grid list with images</a></td></tr><tr><td><strong>↕️ Sorting</strong></td><td>Build</td><td><a href="../tutorials/components/list/create-a-sortable-list">Create a sortable list</a></td></tr><tr><td><strong>▶️ Actions</strong></td><td>Build</td><td><a href="../tutorials/components/list/vertical-list-with-actions">Vertical list with actions</a></td></tr><tr><td><strong>🔄 Data</strong></td><td>Guide</td><td><a href="../tutorials/components/list/how-to-reorder-items-and-update-records">How to reorder items and update records</a></td></tr><tr><td><strong>🌍 Example</strong></td><td>Example</td><td><a href="../tutorials/projects/todays-accounts-to-visit">Today's accounts to visit</a></td></tr><tr><td><strong>🔄 Example</strong></td><td>Example</td><td><a href="https://www.youtube.com/watch?v=u8A8C6oSQy4">Build a reorderable list</a></td></tr></tbody></table>

***

## Step 1 — Choose Your Data Source

The **Data Source** setting determines where the list's content comes from. Pick it first — everything else builds on this choice.

| Data Source                                                                                    | Best For                              | When to Use                                                               |
| ---------------------------------------------------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------------------- |
| [**Manual**](https://docs.avonnicomponents.com/flow/component-builder/data-sources/manual)     | Fixed, pre-defined items              | Static content — e.g., a menu of options that never changes               |
| [**Variable**](https://docs.avonnicomponents.com/flow/component-builder/data-sources/variable) | Items from a Flow collection variable | Content that changes as the flow runs based on prior steps                |
| [**Picklist**](https://docs.avonnicomponents.com/flow/component-builder/data-sources/picklist) | A Salesforce picklist field's values  | Letting users pick from a defined set of options                          |
| [**Query**](https://docs.avonnicomponents.com/flow/component-builder/data-sources/query)       | Live Salesforce records               | Large or complex datasets — replaces the need for a "Get Records" element |

> **Example (Query):** A rep opens a flow and sees all open Accounts assigned to them, fetched directly via Query — no separate "Get Records" step needed.

> **Note:** Images are not supported when using the **Picklist** data source.

***

## Step 2 — Map Your Data

When using Variable or Query as your data source, you need to tell the List which Salesforce fields map to which parts of each item.

Think of **Data Mappings** as a translator: you connect `Account.Name` → Label, `Account.Phone` → Subtitle, and so on. Without it, the list doesn't know what to display.

> **Example:** For a list of Contacts, you might map:
>
> * `Name` → Label
> * `Title` → Subtitle
> * `Email` → Description field

***

## Step 3 — Pick a Variant (Layout Style)

The **Variant** controls the overall shape and behavior of the list.

| Variant              | What It Looks Like                   | Best For                                                 |                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| -------------------- | ------------------------------------ | -------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Base** *(default)* | Vertical list, one item per row      | Detailed records with multiple fields, avatars, or media | ![](https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FheSniNH2fRpVwcdY0wH2%2Fhttps___files.gitbook.com_v0_b_gitbook-x-prod.appspot.com_o_spaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252Fpy3mzaWNOWje1AjDSOQy%252F2024-09-14_07-28-48.png_alt%3Dmedia%26token%3D4f574cb6-5685-4a77-8ea9-76a8852974b0.png?alt=media\&token=40ff1464-48d3-4ced-a4e2-8df9b5c32f7f) |
| **Single-Line**      | Horizontal scrolling row with arrows | Compact summaries, quick navigation between items        | ![](https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FKRgtgNSw8txTZqJTRvUh%2Fhttps___files.gitbook.com_v0_b_gitbook-x-prod.appspot.com_o_spaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252FN8mMiOcjKNvhWWsWgqo7%252F2024-09-14_07-27-59.png_alt%3Dmedia%26token%3D2d6e6e3f-6478-4f3f-b0ee-5512f699ebfd.png?alt=media\&token=4f7aa1dc-96ca-4271-9364-160701b10561) |
| **Checklist**        | Vertical list with checkboxes        | Task lists, preference selections, multi-select input    | ![](https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FfkoxXGOs9Vpm2T4ppQ4Q%2Fhttps___files.gitbook.com_v0_b_gitbook-x-prod.appspot.com_o_spaces%252F1FUd4apB9YHgCEMUFbVb%252Fuploads%252Fc0xMqc8rZJ6pFq0exCfH%252F2024-09-14_07-26-59.png_alt%3Dmedia%26token%3Db4b209d4-d55a-4a85-abbb-fb6ea069c4fc.png?alt=media\&token=34318cdb-3e37-43b3-8471-ff6d68ad10ae) |

> **Example (Base):** A master-detail layout — click a Contact in the list to see their full record on the right.

> **Example (Single-Line):** Show today's scheduled account visits in a horizontal strip at the top of a flow screen.

> **Example (Checklist):** A pre-visit checklist a field rep completes before logging a call.

#### Checklist-Specific Settings

When **Checklist** is selected, two additional options appear:

<table><thead><tr><th width="237.0029296875">Setting</th><th>What It Does</th></tr></thead><tbody><tr><td><strong>Strike-Through on Check</strong></td><td>Draws a line through completed items — gives users instant visual confirmation</td></tr><tr><td><strong>Show Check Counter</strong></td><td>Displays a live count of checked items — e.g., "3 of 7 completed"</td></tr></tbody></table>

***

## Layout & Display

### Columns

Control how many columns the list uses, from 1 to 12. Set different column counts for each screen size to enable responsive behavior.Set different column counts for each screen size to enable responsive behavior.

> **Example:** 1 column on mobile, 3 columns on desktop — great for a product or account card grid.

### Dividers

Dividers visually separate list items. Choose a style to match your design:

<table><thead><tr><th width="125.33333333333331">Divider</th><th width="309">Description</th><th>Illustration</th></tr></thead><tbody><tr><td><strong>Top</strong></td><td>Allows you to place a divider at the top of each item in the list.</td><td><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FnglirvH4eldqktiCiDIG%2F2023-09-03_20-33-55.png?alt=media&#x26;token=a893f6f6-a292-46b2-b87b-06ddc308eb3b" alt=""></td></tr><tr><td><strong>Bottom</strong></td><td>Adds a divider line at the bottom of each list item.</td><td><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FcQGHIBjGtN3x4PctPkWx%2F2023-09-03_20-34-23.png?alt=media&#x26;token=1d74f3c1-c1c3-4a45-b81f-5a84512fcbe0" alt=""></td></tr><tr><td><strong>Around</strong></td><td>Places divider lines both above and below each item in the list. </td><td><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FKrSFhUQArSOftbTERhNu%2F2023-09-03_20-34-47.png?alt=media&#x26;token=32dcefec-8ed0-4a32-a888-fad581a681a9" alt=""></td></tr><tr><td><strong>Card</strong></td><td>Sets each list item within its own card-like container, separated by dividers.</td><td><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FYooeO7cgJRSYvxJlwCAg%2F2023-09-03_20-36-02.png?alt=media&#x26;token=85e012d1-4c90-4222-a765-bcd014bb144d" alt=""></td></tr></tbody></table>

### Item Clickable

Toggle this on to make entire list items clickable (not just action buttons). Wire the click to an interaction to navigate, open a modal, or trigger flow logic.

***

## Item Content

### Avatar

Display a profile image, icon, or initials alongside each item.

<table><thead><tr><th width="191.6171875">Attribute</th><th>Options</th></tr></thead><tbody><tr><td><strong>Variant</strong></td><td>Circle, Square, Empty</td></tr><tr><td><strong>Icon Size</strong></td><td>Small, Large</td></tr><tr><td><strong>Position</strong></td><td>Left, Top-Left, Bottom-Left, Right, Top-Right, Bottom-Right, Left-of-Title</td></tr><tr><td><strong>Presence Position</strong></td><td>Top-Left, Top-Right, Bottom-Left, Bottom-Right (for status indicators)</td></tr></tbody></table>

### Images

Add an image to any list item. Configure position, size, height, and crop behavior directly in the component settings.

> Note: Images are not available with the Picklist data source.

### Fields

Display additional Salesforce fields beneath each list item's main label.

**To set up fields:**

1. Go to the **Fields** attribute at the bottom of the Properties Panel and add the fields you want to display
2. In **Field Attributes**, define how many columns each field spans within the item

**Field label styles:**

<table><thead><tr><th width="180.42578125">Variant</th><th>What It Looks Like</th></tr></thead><tbody><tr><td><strong>Standard</strong></td><td>Label sits above the value — clean and readable</td></tr><tr><td><strong>Label Hidden</strong></td><td>No label shown — good when the field's purpose is obvious</td></tr><tr><td><strong>Label Inline</strong></td><td>Label sits to the left of the value — efficient use of horizontal space</td></tr><tr><td><strong>Label Stacked</strong></td><td>Label floats above the value when focused — modern, mobile-friendly</td></tr></tbody></table>

***

## Header

The header appears above the list and provides context and global controls.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FNnbC3WeszZ003Y0pkDOR%2F2023-07-03_20-45-20.png?alt=media&#x26;token=634239f7-8287-44e0-8cac-b5f68a51e7a8" alt=""><figcaption><p>Header section on a list</p></figcaption></figure>

<table><thead><tr><th width="119.009765625">Attribute</th><th>Purpose</th></tr></thead><tbody><tr><td><strong>Title</strong></td><td>Identifies what the list contains</td></tr><tr><td><strong>Caption</strong></td><td>Short description or context below the title</td></tr><tr><td><strong>Icon</strong></td><td>Visual indicator of the list's purpose</td></tr><tr><td><strong>Is Joined</strong></td><td>Removes bottom border/shadow so the list blends with a component directly below it</td></tr><tr><td><strong>Buttons</strong></td><td>Global action buttons — wired to the "On Header Action" interaction</td></tr></tbody></table>

> **Example (Is Joined):** Place a List directly below a search bar component and enable Is Joined — they appear as one unified panel.

***

## Actions

Actions let users *perform actions from within the list — edit, navigate, delete, or trigger* flow logic.

### Item Actions

Buttons or links attached to individual list items.

> **Example:** An "Edit" button on each Contact row that opens an edit screen in the same flow.

### Media Actions

Buttons embedded in images or video thumbnails.

> **Example:** A "View Details" button overlaid on a product image that opens a detail screen.

***

## Filtering & Search

### Search

Toggle on **Searchable** to add a search bar above the list.

| Setting              | Options                                |
| -------------------- | -------------------------------------- |
| **Placeholder text** | Custom hint text inside the search bar |
| **Position**         | Left, Right, Center, Fill              |

> **Tip:** Use descriptive placeholder text — "Search by account name or city" is more helpful than "Search…"

### Filters

Add fields as filters so users can narrow down what the list shows.&#x20;

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F54RIN1Fel0HvekjaygHT%2F2023-11-27_20-21-50.png?alt=media&#x26;token=b2340f3f-c63b-4da7-9791-8e904ad7e4ff" alt=""><figcaption><p>How to add filters</p></figcaption></figure>

Choose how filters are displayed by going on the filter section.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2Fg6vJUmMf8jyg7LAMEeeI%2F2024-02-18_14-21-17.png?alt=media&#x26;token=6ea0d335-0458-4eb3-8a66-f5aee2797697" alt=""><figcaption></figcaption></figure>

| Filter Type    | How It Works                                   | Best For                                                       | Illustration                                                                                                                                                                                                                    |
| -------------- | ---------------------------------------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Horizontal** | Filter pills appear directly above the list    | Quick access, desktop-first flows                              | ![](https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FGsya7RfEauWsLzqQqrT5%2F2024-03-15_14-21-46.png?alt=media\&token=fd2aa178-a678-4f32-a6e5-97e88274a06b) |
| **Popover**    | Filters hide behind a button — click to reveal | Keeping the interface clean when filters are used occasionally | ![](https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FC6GqttQPOSU7JbBcAtoN%2F2024-03-15_14-22-47.png?alt=media\&token=55a2156f-e684-471f-9594-de5e4429f8d9) |
| **Side Panel** | Filter panel slides in from left or right      | Complex filter sets with many fields                           | ![](https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F4G2Zhx1MxXBPUIzsqqc4%2F2024-03-15_14-23-44.png?alt=media\&token=df5e05ae-1b91-41be-99b2-1abfb05bd927) |

**Side Panel settings**

| Setting                       | Options        | When to Use                                                                    |
| ----------------------------- | -------------- | ------------------------------------------------------------------------------ |
| **Position**                  | Left, Right    | Match the panel to your overall layout                                         |
| **Is Closed (default state)** | Open or Closed | Closed = focus on data first; Open = encourage filtering upfront               |
| **Hide Toggle Button**        | Show or Hide   | Hide when you want another element (like a header button) to control the panel |

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F92HjyQLvmVu7CWhEbicY%2F2024-02-18_14-23-32.png?alt=media&#x26;token=ad787dff-7ff3-4b05-820c-be1f5dacd944" alt=""><figcaption></figcaption></figure>

***

## Sorting & Reordering

### Sort (by Field)

Enable **Sortable** to add a sort indicator to list items, allowing users to reorder items by a chosen field.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FQrGN65Jj2COPO9Dqzpmo%2F2023-11-27_20-23-27.png?alt=media&#x26;token=9d07065f-aeb2-4fc7-a458-6751214bd425" alt=""><figcaption><p>How to activate the Sortable option</p></figcaption></figure>

### Drag-to-Reorder

Let users manually drag items into a new order. When reordering is enabled, wire the **On Reorder** interaction to an update action to persist the new order to Salesforce.

> ⚠️ **Important:** You must set an **Order By** field in the list settings for drag-to-reorder to work correctly with the "Update records order" interaction option.

> **Example:** A rep drags their top priority accounts to the top of the list. The flow automatically updates an "Order" field on each Account record to reflect the new sequence.

***

## Pagination

Split long lists into pages to keep the interface fast and readable.

| Setting                   | Description                                    | Options                        |
| ------------------------- | ---------------------------------------------- | ------------------------------ |
| **Show Pagination**       | Display or hide pagination controls            | Enable / Disable               |
| **Items Per Page**        | How many items show per page                   | 1–200                          |
| **Alignment**             | Where pagination controls appear               | Left, Center, Right            |
| **Button Labels & Icons** | Customize First, Last, Next, Previous controls | Adapt for language or branding |

***

## Interactions

Wire list events to Flow actions.&#x20;

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FDOqntF4vNE2VMoGXSw0V%2F2024-09-14_07-30-24.png?alt=media&#x26;token=c3b55317-1cd6-4b1d-8667-74d12fd9dc72" alt=""><figcaption></figcaption></figure>

Here's what each interaction does:

| Interaction               | Fires When...                                       | Common Uses                                                   |
| ------------------------- | --------------------------------------------------- | ------------------------------------------------------------- |
| **On Item Click**         | User clicks a list item (when Item Clickable is on) | Navigate to a detail screen, open a modal, pre-fill a form    |
| **On Action Click**       | User clicks an item-level action button             | Edit a record, delete an item, trigger a sub-flow             |
| **On Header Action**      | User clicks a header button                         | Filter or sort the list, open a global action                 |
| **On Media Action Click** | User clicks a button within an image or video       | Open a detail view, start playback, link to a record          |
| **On Reorder**            | User drags items into a new order                   | Update an order field on each record to save the new sequence |

{% hint style="warning" %}

#### Important regarding the Reorder interaction

Ensure you've set an "Order By" field in the list settings to make this work. This will enable the "**Update records order**" option in the interaction settings.

<img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FaFyulzr9lcD7nznIOJNi%2F2024-09-14_07-38-27.png?alt=media&#x26;token=ac510b4e-2b0f-4db8-8b27-ff0febc8f2e8" alt="" data-size="original">
{% endhint %}

***

## Output Variables

The List exposes several output variables you can reference in your flow after the screen. To use them, select the screen element in Flow Builder, then the List component, and pick the output variable you need.

### Item Selection

When users check items in the List, these variables update automatically.

| Output variable         | Type                           | What it returns                                                                                                                             |
| ----------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **Selected Items**      | Record Collection (SObject\[]) | All currently selected items as a collection of Salesforce records. Use this to loop through selected records in a subsequent flow element. |
| **Selected Item Names** | Text Collection (String\[])    | The names of all selected items, as a list of strings.                                                                                      |

> **Example:** After the List screen, use a **Loop** element to iterate through **Selected Items** and update each record's status — e.g., mark each selected Task as "Completed".

### Item Clicks

When users click on a list item (requires **Items Clickable** to be enabled), these variables tell you which item was clicked.

| Output variable       | Type             | What it returns                                          |
| --------------------- | ---------------- | -------------------------------------------------------- |
| **Clicked Item**      | Record (SObject) | The full Salesforce record of the item the user clicked. |
| **Clicked Item Name** | Text (String)    | The name of the clicked item.                            |

> **Example:** Use **Clicked Item** in the next screen to display the full details of the record the user selected from the list.

### Action Clicks

When users click an item-level action button, these variables identify which action was triggered and on which item.

| Output variable                   | Type             | What it returns                                                                                                                                      |
| --------------------------------- | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Clicked Item Action Item**      | Record (SObject) | The full Salesforce record of the item where the user clicked an action.                                                                             |
| **Clicked Item Action Name**      | Text (String)    | The name of the action the user clicked (e.g., "Edit", "Delete"). Use in a **Decision** element to route the flow based on which action was pressed. |
| **Clicked Item Action Item Name** | Text (String)    | The name of the item where the action was clicked.                                                                                                   |

> **Example:** A row action called "Edit" is triggered. Use a **Decision** element to check if **Clicked Item Action Name** equals "Edit", then navigate to a record edit screen using the data from **Clicked Item Action Item**.

### Media Action Clicks

When users click a button within an image or video area of a list item, these variables capture the interaction.

| Output variable                         | Type             | What it returns                                                               |
| --------------------------------------- | ---------------- | ----------------------------------------------------------------------------- |
| **Clicked Item Media Action Item**      | Record (SObject) | The full Salesforce record of the item where the user clicked a media action. |
| **Clicked Item Media Action Name**      | Text (String)    | The name of the media action the user clicked.                                |
| **Clicked Item Media Action Item Name** | Text (String)    | The name of the item where the media action was clicked.                      |

> **Example:** On a Product List with product images, a media action "View Details" lets users click the image to navigate to the product detail screen.

### Header Actions

| Output variable                | Type          | What it returns                                                                                                                                                          |
| ------------------------------ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Clicked Header Action Name** | Text (String) | The name of the header action button the user clicked (e.g., "New", "Export"). Use in a **Decision** element to route the flow based on which header button was pressed. |

### Reordered Items

When users drag items into a new order (requires the **On Reorder** interaction to be configured), these variables capture the new sequence.

| Output variable          | Type                           | What it returns                                                                                                                                                |
| ------------------------ | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Sorted Items SObject** | Record Collection (SObject\[]) | All items in their new order as a collection of Salesforce records. Use this with an **Update Records** element to save the new sort order back to Salesforce. |
| **Items**                | Collection (ListItem\[])       | All items in their new order, using the component's internal ListItem format. Use **Sorted Items SObject** instead if you need standard Salesforce records.    |
| **Items Serialized**     | Text (String)                  | The reordered items as a JSON string. Useful for passing to an Apex action or subflow that expects serialized input.                                           |

> **Example:** After the user drags items into a new order, pass **Sorted Items SObject** into an **Update Records** element to persist the new sequence in an "Order" field on each record.

### Component Metadata

| Output variable     | Type    | What it returns                                                                                                                   |
| ------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **Number of Items** | Integer | The total number of items currently loaded in the list. Useful for displaying a count or making decisions when the list is empty. |
