---
schema_version: "1"
id: 6c482cb8f2231742debabaac74e7f6150a14b5867c24a8d19d3d452d69075e1d
title: "Example: Send a Rich Choice Response to a Customer With a Flow"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/agent_response_recipe_rich_choice_flow.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.agent_response_recipe_rich_choice_flow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 916a3b4296cdde94e13da3f9ab041d7bf76e5e5c12c81b71b780d88ebf19f82c
description: In this example, you send product options using an autolaunched flow and rich choice response. You also help the agent decide whether to present text-based product options as buttons or a list.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Example: Send a Rich Choice Response to a Customer With a Flow

In this example, you send product options using an autolaunched flow and rich choice response. You also help the agent decide whether to present text-based product options as buttons or a list.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions. <a href="https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&amp;release=264.0.0&amp;type=5" title="Learn about agent types and default templates for specific clouds and common use cases.">Required add-on licenses vary by agent type.</a></td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d60006e80">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d60006e80 ">To build and manage Service Agents:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d60006e80 ">
              <p>Manage Agentforce Service Agents AND Manage AI Agents</p>
              <p>OR</p>
              <p style="margin-bottom:0;">Customize Application</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d60006e80 ">To open, edit, or create a flow in Flow Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d60006e80 ">Manage Flow</td>

          </tr>
        </tbody>
      </table>

Before you begin:

- [Create an Agentforce Service agent](https://help.salesforce.com/s/articleView?id=ai.service_agent_setup.htm&release=264.0.0&type=5 "Agentforce Service agents intelligently support your customers by connecting to messaging and other channels and escalating to reps when necessary. Use the default Agentforce Service Agent template to create an agent designed to resolve common support cases and requests. Or select from more specialized templates to fit your use case."). If you want to use an active agent, create a version of it or deactivate it.
- [Connect a service agent to an enhanced Messaging channel](https://help.salesforce.com/s/articleView?id=ai.agent_parent_deploy_messaging.htm&release=264.0.0&type=5 "Route conversations to your Agentforce Service agents and Agentforce Employee agents with messaging channels, including Enhanced Chat and other enhanced messaging channels. Learn how to use context variables, multiple languages, and progess indicators in messaging channels.").
- If you haven’t worked in Flow Builder before, see [Automate Tasks with Flows](https://help.salesforce.com/s/articleView?id=platform.flow.htm&language=en_US&type=5).

## Create Product Records

Create a few active product records. Later, your agent uses information from these records in responses. Make sure that the agent user has access to the Product object and its fields.

For example, you can [create product records](https://help.salesforce.com/s/articleView?id=sales.products_guidelines_for_creating.htm&type=5&language=en_US) with this information:

- Product Name: Performance Tee
    
    Product Description: Lightweight, moisture-wicking short-sleeve shirt designed for activity and comfort.
- Product Name: Denim Jeans
    
    Product Description: Modern jeans made with stretch fabric for maximum comfort and movement.
- Product Name: Cotton Socks
    
    Product Description: Durable, breathable ankle-length socks for everyday use. One size fits all.
- Product Name: Crewneck Sweater
    
    Product Description: Classic, soft cotton sweater for year-round casual wear. Available in six colors.
- Product Name: Utility Jacket
    
    Product Description: Water-resistant, hooded jacket with multiple pockets for practical outdoor use.

## Create a Flow

To retrieve product records, create an autolaunched flow. Later, you create a custom agent action based on this flow. Make sure that the agent user has the Run flows permission.

1. From Setup, in the Quick Find box, enter Flows, and then select **Flows**.
2. Click **New Flow** and then select **Autolaunched Flow (No Trigger)**.
3. In Flow Builder, create a productList resource with these properties.
    1. Data Type: Record. Select Allow multiple values (collection).
    2. Object: Product
    3. Availability Outside the Flow: Available for output
4. Create a recordId resource with these properties.
    1. Data Type: Text
    2. Availability Outside the Flow: Available for input
5. After the Start element, click ![add icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/resources-global/_corporate/images/flow_plus_icon.png) and then add a Get Records element with these properties.
    1. Label: Get Products
    2. Get Records of This Object: Select the Salesforce Object data source. From the Object dropdown, select the Product object.
    3. Filter Product Records: Select the **None–Get All Product Records** condition requirement.
    4. How Many Records to Store: All Records
    5. How to Store Record Data: Choose fields and assign variables (advanced).
    6. Select Variable to Store Product Records: The productList resource that you created.
    7. Select Product Fields to Store in Variable: Product Name, Product Description
6. Save and activate the flow.

## Create a Custom Agent Action

Create a custom agent action that uses the Get Products flow as a reference action.

1. Reference Action Type: Flow
2. Reference Action: Get Products
3. Agent Action Instructions: Finds and retrieves product records. For each product, retrieve its name and description. This action is for when a user asks for products.
4. Loading Details: Getting products
5. recordId input instructions: The single ID of the Salesforce record with the product name.
6. productList output instructions: A list of products. Select **Show in conversation**.

## Create a Custom Subagent

Create a custom subagent that sends product options.

1. Open your Agentforce Service agent in Agentforce Builder.
2. [Create a custom subagent](https://help.salesforce.com/s/articleView?id=ai.copilot_topics_add_custom.htm&release=264.0.0&type=5 "Create a custom subagent to specify the actions and instructions an agent needs to meet your users’ particular business needs.") with these properties.
    1. Classification Description: Handles inquiries related to searching for products, including gathering user requirements and presenting product options. For example, use this subagent when the user says: "What product do you have?"
    2. Scope: My job is only to assist customers with searching for products by gathering user requirements and presenting available product options based on user requests.
    3. Instructions: Use the Get\_Products action to get product options.

## Guide Agent Responses with Subagent Instructions

Add a subagent instruction that helps the agent decide how to present text-based product options.

1. To encourage the agent to send options as buttons, tell it to present choices. For example: Present products in a clear, organized format with details like the description. Instruct the user to choose an option to see more details.
2. To encourage the agent to send options as a list, tell it to not present choices. For example: Present products in a clear, organized format with details like the description. Do not ask the user to select or choose a specific product.

To test your agent, activate it and then chat with it on a connected channel.