Loading
Upcoming Mandatory Changes to Public Key Infrastructure (PKI)Read More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Agentforce and Einstein Generative AI
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Adaptive Response Format: Rich Choice Response

          Adaptive Response Format: Rich Choice Response

          A rich choice response is a question with a list of records specific to the end-user. Currently, rich choice response is available for Agentforce Service Agent only.

          Required Editions

          Available in: Lightning Experience
          Available in: Enterprise, Performance, Unlimited, and Developer Editions with Foundations, or Agentforce 1 or Einstein 1 Editions

          Adaptive Response Format Details

          Mapped messaging component Question with dynamic options
          Supported channels

          For supported channels, see channels associated with the Messaging connection.

          Rich choice responses appear as rich content in Omni Supervisor.

          Considerations

          • You can’t customize the mapped messaging component in Messaging Component Builder.
          • Rich choice response supports these messaging component formats:
            • Buttons for Enhanced Chat, enhanced WhatsApp, enhanced Facebook Messenger, and enhanced LINE channels
            • Card Carousel for Enhanced Chat, enhanced Facebook Messenger, and enhanced LINE channels
            • List Selector for enhanced WhatsApp and enhanced Apple Messages for Business channels
            • Text for all supported channels
          • The number of options that a rich choice response can include depends on the messaging component format it's mapped to and the channel that it's sent on. For example, rich choice response supports up to 10 options for the Card Carousel format on enhanced Facebook Messenger channels. For more information, see Messaging Component Formats.
          • Rich choice response supports Case, Product, Asset, Order, and custom records.
          • Rich choice response supports PNG, JPEG, and JPG image formats.
          • To prevent disruptions in performance, include the MIME type with each image or include an image URL with a .jpg, .jpeg, or .png file extension. If you don’t include the MIME type or a URL with a supported file extension, the image MIME type defaults to image/jpeg.
          • To use rich choice response with a custom client deployment that uses the Enhanced Chat REST API, the client must support the Text, Card Carousel, Buttons, and List Selector messaging component formats.

          To use the rich choice responses that include images in agent responses, create a custom agent action that returns the required information. For a sample reference action, see the example Apex class.

          Name
          Name of the list option.
          MIME Type
          Optional. MIME Type of the image. For example, image/jpeg.
          Image URL
          Publicly accessible URL of the image. As a best practice, include the image file extension. For example, www.example.com/image.jpg.
          Description Text
          Optional. Text sent immediately before the rich choice. For example, 'We have a variety of items that are made with most incredible materials. Learn more about this item and how it was created.'

          This Apex class retrieves a list of item options based on a category name. It returns a list of objects, each containing an item name, image URL, MIME type, and description text.

          Example
          Example
          public with sharing class ItemOptionService {
          
              // Defines structure of an item name-image pair
                  public class ItemDetail {
                  public String itemName;
                  public String itemImageUrl;
                  public String itemMimeType;
                  public String itemDescriptionText;
                  public ItemDetail(String itemName, String itemImageUrl, String itemMimeType, String itemDescriptionText) {
                      this.itemName = itemName;
                      this.itemImageUrl = itemImageUrl;
                      this.itemMimeType = itemMimeType;
                      this.itemDescriptionText = itemDescriptionText;
                  }
              }
          
              // Represents an object that holds a list of item name-image pairs
              public class ItemOptionWrapper {
                  @InvocableVariable(label='Item Options' required=true)
                  public List<ItemDetail> itemDetails;
                  public ItemOptionWrapper() {
                      this.itemDetails = new List<ItemDetail>();
                  }
              }
          
              // Reprents input for getItemOptionsByCategory
              public class ItemOptionInput {
                  @InvocableVariable(label='Category Name' required=true)
                  public String categoryName;
              }
          
              @InvocableMethod(label='Get Item Options by Category' description='Returns a list of item options based on the category name')
              public static List<ItemOptionWrapper> getItemOptionsByCategory(List<ItemOptionInput> categoryNames) {
                  System.debug('categoryNames: ' + categoryNames);
          
                  // Get the category name from the input list
                  String category = categoryNames[0].categoryName.toLowerCase();
                  System.debug('Processing category: ' + category);
          
                  ItemOptionWrapper selectedItemWrapper = new ItemOptionWrapper();
                  if(category.contains('category1')) {
                      selectedItemWrapper.itemDetails.add(new ItemDetail('Item1', 'https://example.com/images/item1.jpg', 'image/jpeg', 'We have items that are great and made with most incredible materials. Learn more about item 1 and how it was created.'));
                      selectedItemWrapper.itemDetails.add(new ItemDetail('Item2', 'https://example.com/images/item2.jpg', 'image/jpeg', 'We have items that are great and made with most incredible materials. Learn more about item 2 and how it was created.'));
                  } else if(category.contains('category2')) {
                      selectedItemWrapper.itemDetails.add(new ItemDetail('Item3', 'https://example.com/images/item3.jpg', 'image/jpeg', 'We have items that are great and made with most incredible materials. Learn more about item 3 and how it was created.));
                  } else {
                      selectedItemWrapper.itemDetails.add(new ItemDetail('Default Item', 'https://example.com/images/default.jpg', 'image/jpeg', 'We have items that are great and made with most incredible materials. Learn more about this item and how it was created.'));
                  }
          
                  System.debug('Returning : ' + selectedItemWrapper);
                  return new List<ItemOptionWrapper>{ selectedItemWrapper };
              }
          }
          
           
          Loading
          Salesforce Help | Article