Prompt Engineering20% of the exam
Grounding techniques: merge fields, flows and retrievers
How to choose between record and related list merge fields, template-triggered prompt flows, Apex and Data 360 retrievers to ground a prompt template, and how to wire a retriever into a template, including activation, run-time search settings, dynamic pre-filters and citations.
Given a scenario, identify the appropriate grounding technique.
~8 min read · 9 practice questions ·
What the exam expects
- Choose the grounding technique for a scenario: record merge fields, related list merge fields, a template-triggered prompt flow, Apex, or a Data 360 retriever.
- Explain why logic such as filtering, sorting or totals belongs in a flow or Apex resource, never in instructions asking the model to do it.
- Recognise unstructured, high-volume or frequently changing content as a retrieval-augmented generation (RAG) job.
- Wire a retriever into a template: create and activate it in AI Models, insert it, set search text, output fields and number of results, and use a dynamic pre-filter when the filter value is only known at run time.
- Key terms: grounding (adding relevant data to a prompt); merge field (a placeholder resolved with Salesforce data); template-triggered prompt flow (the flow type that returns prompt instructions to a template); retriever (searches a Data 360 search index and returns relevant content); dynamic pre-filter (a retriever filter whose value the template supplies at run time).
Key facts
Insertable grounding resources
- Detail
- Record fields, flows, Apex, Data 360 DMOs, related lists
Merge field limits
- Detail
- 50 merge fields; 5 each for flow, Apex and related list merge fields
Related list grounding
- Detail
- Fields from the page layout; no record-level filters; Activities unsupported
Flow type for templates
- Detail
- Only Template-Triggered Prompt Flow; other flow types aren't available
Flow inputs
- Detail
- All flow inputs are required and must be present in the template
Apex resource
- Detail
@InvocableMethod; returnsList<Response>with aPromptstring
Retriever availability
- Detail
- Built in AI Models, then activated for Prompt Builder; one active version
Default retrievers
- Detail
- No longer created automatically with a new search index
Retriever Search Text
- Detail
- Free text or merge fields from globals and prompt inputs; 255-character limit; not related list, Flow or Apex
Run-time filter value
- Detail
- Needs a retriever filter condition marked Dynamic, mapped in Pre-filter
Citations
- Detail
- Turned on in Template Settings; apply to all retrievers in the template
Retriever name in the UI
- Detail
- Einstein Search was renamed Retriever
Sources for this section (10)
- Ground Prompt Templateshelp.salesforce.com (opens in a new tab)
- Prompt Builder Limitshelp.salesforce.com (opens in a new tab)
- Related List Merge Fieldshelp.salesforce.com (opens in a new tab)
- Flow Merge Fieldshelp.salesforce.com (opens in a new tab)
- Apex Merge Fieldshelp.salesforce.com (opens in a new tab)
- Retrieve Datahelp.salesforce.com (opens in a new tab)
- About Retrievershelp.salesforce.com (opens in a new tab)
- Prefiltershelp.salesforce.com (opens in a new tab)
- Add Citationshelp.salesforce.com (opens in a new tab)
- Ground with RAGhelp.salesforce.com (opens in a new tab)
- Why is a related list merge field the wrong choice for "comments from the last 30 days"?
- When should Apex be preferred to a flow as a grounding resource?
- Why can't a template author find a newly built retriever in Prompt Builder?
- Which flow type can ground a prompt template?
The questions are free to read. Answers with their sources and self-grading are included with the pack.
Keep reading with the Agentforce Specialist pack
- Core concepts
- Exam traps
- Worked scenario
The pack includes:
- All 26 lessons of the Agentforce Specialist guide, with reading progress
- Interactive decision walks and step-by-step sequence steppers
- Inline practice questions and one-click topic practice (9 questions for this lesson)
- An official source cited for every claim
- An AI tutor that answers from the guide
- Unlimited timed practice exams