Skip to main content
Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.

Extend WhatsApp with Messaging Components

Learning Objectives

After completing this unit, you’ll be able to:

  • Discover how messaging components let you send structured content in WhatsApp sessions.
  • Create basic and advanced messaging components.
  • Customize the Service Console so agents can send messaging components to customers.

Discover Messaging Components

Now that Maria has connected Ursa Major Solar’s WhatsApp account to Salesforce, she’s ready to add some high-value agent productivity tools to the channel. In enhanced WhatsApp channels, agents can exchange more than just text with customers: They can also send emojis, images, files, audio messages, videos, and messaging components. 

At Salesforce, structured content such as enhanced links, questions with clickable options, or lists of time slots are referred to as messaging components. Structured content is great for several reasons: It’s scalable, highly customizable, and lets agents and customers exchange information in a way that’s eye-catching, familiar, and fast.

a link messaging component and two question with options messaging components

Maria is full of ideas about how messaging components can save their support team time. She starts by making a list of common interactions that agents have with customers. Then, she brainstorms ways to automate those interactions using messaging components.

Agent Task

Messaging Component Solution

Setup Time

Send the customer to Ursa Major’s “Sizzling Hot Sales” web page.

Create an enhanced link component that leads to the web page.

Under 5 minutes

Find out the category of the customer’s problem. 

Create a question with static options component that prompts customers to select from a clickable list of four contact reasons.

5-10 minutes

Find out which order the customer is inquiring about.

Create a question with dynamic options component that shows a clickable list of the customer’s three most recent orders.

30+ minutes

Requires flows

Find a time slot for a solar installation appointment.

Create a time selector component that shows the next four open time slots.

30+ minutes

Requires flows

Requires Apex

Create a Basic Messaging Component

Maria wants to provide her support team with a messaging component that prompts customers to select their issue from a list of categories. She has a few minutes before her lunch break, so she heads to Setup to create it.  

  1. Click the gearSetupto open Setup, and go to the Messaging Components page.
  2. Click New Component, Next, and then select Question with Options.New Messaging Component window with Question with Options selected
  3. Select the type of options to show. Maria wants her component to show the same list of categories to every customer, so she selects Static Options.
    Component setup flow screen with Static Options selected and Dynamic Options not selected
  4. Enter a prompt. Maria enters: What do you need help with? 
  5. Enter the options to show, and reorder them if needed.Component setup flow screen with four options entered: Billing, Appointments, Choosing a product, and Technical support
  6. Give your component a name that will help agents quickly understand its purpose, and add a description. Then, click Done to open the Messaging Component Builder, where you can further customize your component.
    Component setup flow screen with a name, developer name, and description added
  7. In the Messaging Component builder, you can add formats to your component to control how it appears in different types of Messaging channels. Some formats are available only in certain channels. Maria wants the options to appear in a vertical list, so she decides to add the List Selector format to her component.
    • Click Add Format.
    • Select List Selector and check that the WhatsApp logo appears next to it. The logo indicates that the format can be used in WhatsApp channels. Then, click Done.Window showing available messaging formats with List Selector selected
    • In the left-hand sidebar, click List Selector to customize this format for your component. To keep things simple, Maria uses the constants created when she entered her component information, and verifies her settings by checking the component preview in the center. Here’s what that looks like.Messaging Component Builder showing List Selector format properties
  1. Click Save.

Success! Maria has created her first messaging component, which will appear in WhatsApp messaging sessions in the List Selector format. Now it’s time to level up and create a more advanced one.

Create an Advanced Messaging Component

When a customer contacts Ursa Major’s customer support team, the agent often needs to know which order the customer is inquiring about. To automate this common interaction, Maria wants to create a messaging component that prompts customers to select from a list of their most recent orders. Here’s what she does.

  1. Click the gear Setup to open Setup, and go to the Messaging Components page.
  2. Click New Component, Next, and then select Question with Options.
  3. Select the type of options to show. Maria wants her component to show customer-specific options, so she selects Dynamic Options.
  4. Enter a prompt. Maria enters: Which order are you inquiring about?
  5. Select the type of record that you want displayed as options. Maria selects Order.
    Component setup screen with Order selected
  6. Choose the way each order will be displayed as an option. You can get fancy—for example, by displaying multiple field values—or keep it simple. In the Plain Text Formula field, Maria selects Order Number so customers will see a list of their most recent order numbers.
    Component setup screen showing the plain text version of the component
  7. Give your component a name that will help agents quickly understand its purpose, like Order Selector, and add a description. Then, click Done to open the Messaging Component Builder, where you can further customize your component.
  8. In the Messaging Component Builder, add a format to customize the way the component looks in WhatsApp channels. Just like last time, let’s use List Selector and rely on constants to finalize the format. Here are the settings that Maria uses.List Selector format in Messaging Component Builder
  9. Maria created her messaging component! But she’s not quite done. To send messaging components with dynamic content, like this one, she’ll create a simple flow and add it to the Service Console. Whenever an agent wants to send the component, they can run the flow in the Service Console to insert the message into the current messaging session. For detailed instructions, see Set Up a Flow to Send Question Messaging Components in Salesforce Help.

Show Messaging Components in the Service Console

To send messaging components with static content, agents click the messaging component action in the messaging window of the Service Console and select from a list of components.

Messaging component action in messaging window

But messaging components with dynamic, customer-specific content—questions with dynamic options and time selectors—enjoy their space, so they appear in their very own Flow component. Maria adds the Flow component to the Messaging Session layout, and selects the flow that she created for her dynamic messaging component.

Tip: If you have multiple components with dynamic content, group their corresponding Flow components into an Accordion component so agents can find them quickly. Give the accordion a helpful name, like Messaging Components (Dynamic). Here’s what that looks like:

Accordion component containing two flow components

With a WhatsApp channel and two fine-looking messaging components, Maria’s ready to test out the agent experience. Let’s follow along as she exchanges messages in her new WhatsApp channel.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback