comment-dotsAgent Chat

Overview

The Agent Chat component displays a conversational chat interface connected to an 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.


Quick Start

Scenario: Add an Employee Assistant chat to a Lightning Home Page, powered by an existing Agentforce agent.

1

Add the Agent Chat component

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

  • 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 Reference

Agent

Controls which Agentforce agent powers the chat.

Setting
Description
Example / Options

Agent API Name

The API name of the Agentforce agent to connect to. Must match the agent's API name in Salesforce Setup exactly.

Agentforce_Employee_Agent


Content

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

Setting
Description
Example / Options

Hide Welcome Image

Hides the default robot illustration on the welcome screen. (Default: off)

On / Off

No Results Title

The heading shown on the welcome screen.

Let's chat!, How can I help you today?

No Results Message

A supporting message shown below the title on the welcome screen. Leave blank to show the title only.

Ask me anything about your open cases.

Disabled

Prevents users from typing or sending messages. Use to temporarily lock the component without removing it. (Default: off)

On / Off


Chat Input

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

Setting
Description
Example / Options

Placeholder

The hint text shown inside the input field before the user types.

Describe your task or ask a question...


Set Component Visibility

Controls when the Agent Chat component is visible on the page. Use this to show or hide the component based on field values, user profile, or other conditions without configuring a separate rule on the Lightning Page.

Refer to the Component Visibility documentation for the full list of supported conditions.


Common Patterns

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 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).


Troubleshooting

chevron-rightThe chat loads but the agent does not respondhashtag
  • Cause: The Agent API Name does not match the agent's API name in Salesforce Setup, or the agent is inactive.

  • Fix: Go to Salesforce Setup → Agentforce → confirm the API name and that the agent is active. Copy the exact API name into the component's Agent API Name field.

chevron-rightThe welcome screen does not appearhashtag
  • Cause: Hide Welcome Image is toggled on and No Results Title is blank, leaving the welcome state empty.

  • Fix: Either toggle Hide Welcome Image off, or enter a value in No Results Title.

chevron-rightUsers cannot type in the input fieldhashtag
  • Cause: The Disabled toggle is on.

  • Fix: Toggle Disabled off in the Properties Panel, then save and re-activate.

Last updated

Was this helpful?