Sub topic 1
Why Prompts Need Grounding in Salesforce Prompt Builder
Prerequisites
Assume you know Salesforce objects, fields, relationships, permission sets, basic Flow Builder, and introductory Apex. You should also understand that a prompt is the instruction and context sent to a large language model.
Why Prompts Need Grounding
Grounding means adding trusted, relevant data to a prompt. An ungrounded prompt asks a model to answer from general training or from incomplete context. It might invent a case status, miss an account detail, or produce a generic response.
Salesforce Prompt Builder grounds prompts with CRM data before sending them to the model. The model can then summarize the actual record, draft a response using current values, or follow rules based on the record's context.
Prompt Templates and Template Types
A prompt template is a reusable prompt with instructions and placeholders for data. Prompt Builder's template type defines the context in which the template runs and the output it produces. Common types include record summaries, field generation, sales emails, and flexible prompts.
A template usually combines:
- Instructions for the model.
- Grounding data from Salesforce.
- Rules for missing or ambiguous values.
- An expected output format.
The template type also determines which input records and resources are available.
Template Inputs: The Record Behind the Prompt
A template input is the record that anchors the prompt. For example, a Case record can provide the subject, status, priority, and description. Prompt Builder exposes that record through the $Input merge-field namespace.
The input record is important because it gives the template a specific execution context. The same template can run for many cases, while each execution resolves fields from the current case.
Inserting Record Fields with Merge Fields
A merge field is a placeholder that Prompt Builder replaces with a Salesforce value at runtime. Use the correct input object and field path, then tell the model how to handle empty values.
You are a support assistant. Summarize this case in two sentences.
Subject: {!$Input:Case.Subject}
Status: {!$Input:Case.Status}
Priority: {!$Input:Case.Priority}
Description: {!$Input:Case.Description}
If a value is empty, say it is not provided. Do not guess.A field's permissions and data quality affect the resolved prompt. A user who cannot access a field may not provide usable grounding, and an empty field gives the model less context.
Exercise
Why should a template explicitly explain how to handle an empty merge field?
Show answer
Without that instruction, the model may infer a value or produce an incomplete response instead of acknowledging the missing data.