Sub topic 8
Summarizing a record
This chapter assumes you know the Salesforce data model, can work in Setup, and have already added a standard action to a topic in Agentforce Builder. It also assumes you have read the chapter on finding and reading records.
What the action does
The Summarize Record action takes one record and returns a short natural-language summary of it. The agent can then pass that summary to the user, or use it in a later step such as drafting an email.
Use it when the user wants an overview, such as "Give me a summary of the Acme account." Use Get Record Details instead when the user asks for one specific field value. A summary is generated text. A field lookup returns the stored value.
Inputs and outputs
The action needs the record to summarize. It identifies that record by its ID, not by name. If the user says "Acme," the agent does not yet have an ID, so it must find the record first.
| Part | Role |
|---|---|
| Input: record | The ID of the record to summarize |
| Output: summary | The generated text the agent can show or reuse |
The exact input and output labels in your org may differ slightly. Open the action in Agentforce Builder to see them.
The usual order of steps
Summarizing depends on a lookup. The lookup produces the ID, and the summary action consumes it.
If the user is already viewing a record in the app, the agent may have its ID from context. Do not count on that. Write the instructions so the lookup happens whenever no ID is available.
Writing the topic instructions
The instructions decide when the agent chooses this action. Be explicit about the trigger and the order:
Instructions:
1. When the user names an account, first find the account record, then use the result for any later step.
2. Use the summary action when the user asks for an overview of an account.
3. If you cannot find exactly one matching record, ask the user to clarify instead of guessing.Rule 3 matters most here. Two accounts with similar names can lead the agent to summarize the wrong one. The summary will read fluently, so the mistake is hard to notice.
Access and data
The summary reflects only what the running user can see. Sharing rules and field-level security still apply. Two users who ask about the same account may get different summaries. This is expected. When you test, run as a user whose permissions match your real audience, not as an administrator.
Common errors
- The agent summarizes from memory instead of calling the action. The instructions do not clearly tie "overview" requests to the action. Reword the trigger and retest.
- The action fails or returns nothing. The agent probably passed a name or an empty value instead of an ID. Check that the lookup ran first and that its output was used as the input.
- The summary omits fields you expected. Check the user's field access first. Then check whether the summary's data sources include those fields.
- The wrong record is summarized. The lookup matched more than one record and the agent picked one. Add the clarification rule.
Exercise
A user says "Give me an overview of Globex." The agent replies with a summary of a different account named Globex Corp. Which two parts of the setup do you check, and what do you change?
Show answer
Check the lookup step and the topic instructions. The lookup likely returned several matches and the agent chose one, so the Summarize Record input received the wrong ID. Add an instruction to ask the user to clarify unless exactly one record matches, then retest and confirm in the action details that the correct ID was passed.