> 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/actions/ui-and-navigation/new-carousel-item-collection.md).

# New Carousel Item Collection

Build the slides of an Avonni Carousel in a flow action, with a title, picture, link and name for each, before the screen that shows them.

## Overview

This action builds a collection of slides for the [Avonni Carousel](https://docs.avonnicomponents.com/flow/flow-components/carousel.md) before the screen. Use it when the slides do not come from records, or when a Decision picks one set of slides or another. For slides used on one screen only, typing them in the Carousel with the **Manual** data source is simpler.

> **Example:** A guided selling flow shows three featured add-ons, each with a picture and a link to its datasheet. The action builds the three slides, and the Carousel opens on the add-on recommended for the opportunity.

***

## Input

**Carousel Items** (required) holds one item per slide. Click an item's pencil icon to edit it. **Image Assistive Text** and **Name** sit behind the **Advanced Options** toggle. Each item has these fields:

| Field                    | What to set                                                                                                                      |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| **Title**                | The heading of the slide. Accepts a flow resource.                                                                               |
| **Description**          | The text under the title. Accepts a flow resource.                                                                               |
| **Image Source**         | The URL of the picture, or **Select Image** to pick a file (`.apng`, `.avif`, `.gif`, `.jpg`, `.jpeg`, `.png`, `.svg`, `.webp`). |
| **Image Assistive Text** | The alternative text of the picture. When empty, the title is used.                                                              |
| **URL**                  | The web page the slide opens when clicked.                                                                                       |
| **Target**               | Where **URL** opens: **Self** (default, the current tab), **Blank** (a new tab), **Parent** or **Top**.                          |
| **Name**                 | Required. The name of the slide. The Carousel's **Current Item** setting and its outputs use it.                                 |

Flow Builder refuses to save the action with "One or more carousel items have an empty name" when an item has no **Name**. The flow fails with "You provided an empty value for the carousel items" when **Carousel Items** has no value.

## Output

A collection of carousel items (Apex-defined type `CarouselItem`). Store it in a collection variable of that type, then select the variable in the Carousel with **Data Source** set to **Variable**. No data mapping is needed.

Buttons on the slides are not set here: add them in the Carousel's **Actions** group, where they apply to every slide.

***

## Example

{% stepper %}
{% step %}

### Add the action

Before the screen, add an Action element and select **New Carousel Item Collection** (category Avonni).
{% endstep %}

{% step %}

### Fill the slides

In **Carousel Items**, add `Premium Support` (name `premium-support`), `Onboarding Package` (name `onboarding-package`) and `Extended Warranty` (name `extended-warranty`), each with a **Description**, an **Image Source** and a **URL** to its datasheet.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FgsMjcKJa68dJqK6WItQI%2Fcarousel-build-carousel-slides-with-an-action-items.png?alt=media" alt="New Carousel Item Collection action with three slides and the Premium Support fields filled"><figcaption><p>Each slide gets a title, a picture, a link and a name.</p></figcaption></figure>
{% endstep %}

{% step %}

### Store the output

Store the output manually in a new variable: Data Type Apex-Defined, Apex class `CarouselItem` (the Avonni class, shown with its package prefix), Allow multiple values (collection) selected.
{% endstep %}

{% step %}

### Connect the Carousel

On the screen, open the Carousel's Component Builder, set **Data Source** to **Variable** and select that variable in **Items Collection**.
{% endstep %}
{% endstepper %}

[Build Carousel Slides with an Action](https://docs.avonnicomponents.com/flow/tutorials/components/carousel/build-carousel-slides-with-an-action.md) walks through the whole flow, including links that open in a new tab and a carousel that opens on a chosen slide.


---

# 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/actions/ui-and-navigation/new-carousel-item-collection.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.
