> 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/components/visual-picker/show-records-as-visual-picker-cards.md).

# Show records as Visual Picker cards

Show an Account's open Opportunities as Visual Picker cards in a screen flow, then load the one the rep picks with Get Records and use it.

A sales rep logs a meeting from an Account and has to say which deal it was about. Instead of a lookup search, the screen shows the Account's open Opportunities as cards, with the stage, amount and close date on each. The rep clicks one, and the next steps of the flow work on that Opportunity.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2FcEjQ2tN6Yg0IrCBRN8hK%2Fvisual-picker-show-records-as-visual-picker-cards-result.png?alt=media" alt="Visual Picker showing an Account&#x27;s three open Opportunities as cards with stage, amount and close date, one of them selected"><figcaption><p>Each card is an open Opportunity of the Account.</p></figcaption></figure>

## Before you start

* Your screen flow runs on the Account record page and receives the Account Id in a `recordId` variable. If not, follow [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).
* The [Avonni Flow Screen Components](https://docs.avonnicomponents.com/flow/getting-started/installation-and-licenses-management.md) package is installed and you have its permission set.
* You know how to build a card by hand. [Build Visual Picker items by hand](https://docs.avonnicomponents.com/flow/tutorials/components/visual-picker/build-visual-picker-items.md) covers what each card setting prints.

## Steps

{% stepper %}
{% step %}

### Add a Visual Picker to a screen

Open a **Screen** element and drag the Avonni **Visual Picker** onto it. Give it the API Name `Opportunity_Picker`.

In the **Properties** tab, set **Label** to `Which deal was this meeting about?`, keep **Type** on **Radio** and set **Size** to **Large**.
{% endstep %}

{% step %}

### Query the Account's open Opportunities

Set **Data Source** to **Query** and choose the object `Opportunity`. Under **Filters**, add two conditions:

* **Account ID** **Equals** the `recordId` resource of your flow.
* **Closed** **Equals** `False`.

Under **Order By**, pick **Close Date**, ascending, so the deal closing first comes first. Set **Maximum Number of Records** to `6`: past that, cards are harder to scan than a list.

The query runs when the screen opens, so you need no Get Records element before the screen.
{% endstep %}

{% step %}

### Map the fields to the card

In **Data Mappings**, tell the picker which field goes where on each card:

* **Value**: keep the default, **Id**. This is what the flow receives.
* **Figure Title**: **Name**.
* **Figure Description**: a rich text box. Insert the Stage merge field so it reads `{{Record.StageName}}`.
* **Fields**: **Amount** and **Close Date**.

<figure><img src="https://27923732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1FUd4apB9YHgCEMUFbVb%2Fuploads%2F6O70PCyZ5OxVdOYmwWv6%2Fvisual-picker-show-records-as-visual-picker-cards-data-mappings.png?alt=media" alt="Visual Picker Data Mappings with Value mapped to Id, Figure Title to Name, Figure Description to Stage and Fields to Amount and Close Date" width="375"><figcaption><p>Data Mappings decide which field prints where on the card. Fields sits further down the section.</p></figcaption></figure>
{% endstep %}

{% step %}

### Load the picked Opportunity

After the screen, add a **Get Records** element named `Get_Picked_Opportunity`:

* **Object**: Opportunity.
* **Filter**: `Id` **Equals** `{!Opportunity_Picker.value}`.
* **How Many Records to Store**: **Only the first record**.

`{!Opportunity_Picker.value}` holds the Id of the card the rep clicked, because **Value** is mapped to the record Id.
{% endstep %}

{% step %}

### Use it in the next steps

Every later element can now read the deal: `{!Get_Picked_Opportunity.Name}`, `{!Get_Picked_Opportunity.StageName}`. For example, a **Create Records** element can log the meeting as a Task with **Related To ID** set to `{!Get_Picked_Opportunity.Id}`.

The Visual Picker also returns the record itself in its **Selected Item** output. Get Records is still the safer choice when you need a field the cards do not show.
{% endstep %}

{% step %}

### Save and test

Save and activate the flow, then run it from an Account that has open Opportunities. The screen shows one card per open deal, the earliest close date first, with its stage, amount and close date. Closed deals are not there.

Click a card and **Next**: the following screen or record works on that Opportunity. Run it from a second Account: the cards change with it.
{% endstep %}
{% endstepper %}

## Troubleshooting

<details>

<summary>The picker shows no cards</summary>

`recordId` is empty, so the filter compares **Account ID** with nothing. Run the flow from the Account page with **Pass record ID into this variable** checked, or follow [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) when you debug from Flow Builder.

</details>

<details>

<summary>Get Records finds nothing after the screen</summary>

**Value** is mapped to a field other than the record Id (the name, for example), so the filter on `Id` never matches. Map **Value** back to the record Id, or filter Get Records on the field you mapped.

</details>

<details>

<summary>Closed deals appear on the cards</summary>

The **Closed** **Equals** `False` condition is missing. **Stage** alone does not tell open from closed, because each org names its stages differently.

</details>

## Related tutorials

* [Build Visual Picker items by hand](https://docs.avonnicomponents.com/flow/tutorials/components/visual-picker/build-visual-picker-items.md): tags, icons and locked cards, typed in by hand.
* [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): the same `recordId` filter on other components.
* [Query data source](https://docs.avonnicomponents.com/flow/component-builder/data-sources/query.md): every query option, including filters that react to other components.
* [Visual Picker](https://docs.avonnicomponents.com/flow/flow-components/visual-picker.md): what Selected Item, Selected Items and Value return.


---

# 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/components/visual-picker/show-records-as-visual-picker-cards.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.
