For the complete documentation index, see llms.txt. This page is also available as Markdown.

Agent Chat

The Agent Chat component displays a conversational chat interface powered by a Salesforce Agentforce agent. Use it on Lightning Pages or Experience Sites to let users interact with an AI agent directly from a Salesforce record or app page.

Overview

1

Add the Agent Chat component

  • In the Component Library (left sidebar), locate Agent Chat under Others.

  • Drag it onto the Canvas.

2

Set the Agent API Name

  • Select the component on the Canvas.

  • In the Properties Panel, enter the API name of your Agentforce agent in the Agent API Name field.

  • Example: Agentforce_Employee_Agent

Why: This connects the chat interface to a specific Agentforce agent. The value must match the agent's API name exactly as configured in Salesforce.

3

Customize the welcome screen (optional)

  • Set No Results Title to the greeting users will see before sending their first message (e.g., How can I help you today?).

  • Leave Hide Welcome Image off to show the default robot illustration. Toggle it on for a plain, text-only welcome state.

4

Set the Chat Input placeholder

Under Chat Input, update Placeholder to guide users on what to type (e.g., Describe your task or ask a question...).

5

Save and activate

  • Click Save, then Activate.

  • Add the Dynamic Component to a Lightning Page via Lightning App Builder.

Configuration

To configure the Agent Chat, select it on the canvas. The Edit Agent Chat panel opens on the right with three tabs: Properties, Interactions, and Style. The sections below mirror the Properties tab from top to bottom.

The Properties tab of the Edit Agent Chat panel. Content and Chat Input are collapsible sections, and Disabled sits under Advanced Options.

Agent

Controls which Agentforce agent powers the chat.

Agent API Name — The API name of the Agentforce agent to connect to. The value must match the agent's API name in Salesforce Setup exactly (e.g., AgentforceEmployee or [email protected]).

Content

Controls the welcome screen displayed before the user sends their first message.

The welcome screen, with No Results Title and No Results Message set and the placeholder in the input.
  • Hide Welcome Image — If enabled, the default robot illustration is hidden on the welcome screen. Defaults to off.

  • No Results Title — The heading shown on the welcome screen before any messages are exchanged. Defaults to Let's chat!

  • No Results Message — A supporting message shown below the title on the welcome screen. Leave blank to show the title only.

  • Disabled — If enabled, the chat is locked and users cannot type or send messages. Use to temporarily disable the component without removing it from the page. Defaults to off. Available under advanced options. While Disabled is on the component also stops reacting to the agent: the Message Received interaction does not fire and Last Agent Response is not updated.

The Hide Welcome Image property, off and on.
The Disabled property, off and on.

Chat Input

Controls the message input area at the bottom of the component.

  • Placeholder — The hint text shown inside the input field before the user types. Defaults to Describe your task or ask a question…

Set Component Visibility

All components support conditional visibility — see Component Visibility.

Use Cases

Employee Self-Service Assistant

  • Agent API Name: Agentforce_Employee_Agent

  • No Results Title: How can I help you today?

  • Placeholder: Ask me anything about HR policies, benefits, or IT requests...

  • Add to the Home Page so employees can access the agent from any context.

Case Resolution Assistant

  • Agent API Name: Agentforce_Case_Agent

  • No Results Title: Need help resolving this case?

  • Placeholder: Describe the issue or ask a question...

  • Add to a Case Record Page. The agent has access to the case context through the Agentforce configuration.

Gated Agent (Admin-Controlled)

  • Use the Disabled toggle with a Set Component Visibility rule to enable the chat only for specific profiles or when a record field meets a condition (e.g., Status = Active).

Interactions

Interactions define what happens when users interact with the Agent Chat. Configure them from the Interactions tab of the Edit Agent Chat panel.

Message Received

Fires each time the agent sends a response. Use the lastAgentResponse output to read the agent's reply and drive downstream flow logic, update other components, or store the response in a variable.

This interaction does not fire while the Disabled property is on.

Output Variables

The Agent Chat exposes this output variable you can reference elsewhere on the page after the agent responds.

Message Received

Updates each time the agent sends a response to the user.

Output variable
Type
What it returns

Last Agent Response

Text (String)

The full text of the most recent response received from the agent.

Example: After the agent replies, use Last Agent Response to display the response in a rich-text component elsewhere on the page, or store it in a variable for downstream logic.

Styling

Configure the Agent Chat's appearance from the Style tab of the Edit Agent Chat panel.

Controls the outer spacing around the component.

  • Top / Right / Bottom / Left: Adjust the space on each side.

Controls the inner spacing between the component's content and its border.

  • Top / Right / Bottom / Left: Adjust the inner spacing on each side.

Customizes the border surrounding the component.

  • Color: Set the border color.

  • Size: Set the border thickness.

  • Style: Set the border style (solid, dashed, dotted, etc.).

  • Radius: Round the corners of the border.

Controls the component's dimensions.

  • Width / Height: Set fixed dimensions for the chat.

Styles the messages received from the agent.

  • Background Color: Set the bubble background color.

  • Text Color: Set the message text color.

  • Font Size / Font Style / Font Weight: Adjust the message typography.

Styles the messages sent by the user.

  • Background Color: Set the bubble background color.

  • Text Color: Set the message text color.

  • Font Size / Font Style / Font Weight: Adjust the message typography.

Styles the welcome screen shown before any messages are exchanged.

  • Title: Text Color, Font Size / Font Style / Font Weight.

  • Message: Text Color, Font Size / Font Style / Font Weight.

Troubleshooting Common Issues

  • The chat loads but the agent does not respond — The Agent API Name does not match the agent's API name in Salesforce Setup, or the agent is inactive. Go to Salesforce Setup → Agentforce, confirm the API name and that the agent is active, then copy the exact API name into the component's Agent API Name field.

  • The welcome screen does not appearHide Welcome Image is toggled on and No Results Title is blank, leaving the welcome state empty. Either toggle Hide Welcome Image off, or enter a value in No Results Title.

  • Users cannot type in the input field — The Disabled toggle is on. Toggle Disabled off in the Properties Panel, then save and re-activate.

Last updated

Was this helpful?