Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Grounding entry
How-to guide

How to ground a Prompt Builder template

Grounding is configured per template in Prompt Builder. The steps assume you already have a template in draft state with a clear task definition.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 16, 2026

Grounding is configured per template in Prompt Builder. The steps assume you already have a template in draft state with a clear task definition.

  1. Open the template in Prompt Builder

    Setup, Prompt Builder, open the template. The Resources panel on the right is where grounding sources live.

  2. Add the primary record resource

    Click Add Resource, pick Record, select the object (Case, Account, Contact). The merge syntax {!Input:Case.Subject} appears for fields you reference. Add only the fields the task needs.

  3. Add related records or knowledge

    For service templates, add Knowledge as a resource and configure the search query. For sales templates, add Related Records to pull child records like opportunities or contacts. For cross-system context, add Data Cloud entities.

  4. Preview with a real record ID

    Click Preview, paste a record ID, run. The preview shows the full grounded prompt and the model's response. Test with records that have thin context to see how the model handles sparse data.

  5. Activate and gate behind a permission set

    Activate the template. Create or update a permission set that grants Use Prompt Template on this specific template. Assign to a small pilot group before opening to all users.

Key options
Record groundingremember

Pulls fields from the current record and related records. Respects sharing and field-level security. The default for transactional tasks.

Knowledge groundingremember

Semantic search against published knowledge articles. Required for case summary, reply recommendation, and similar service features.

Data Cloud groundingremember

Pulls from unified profile data, including web behavior, marketing engagement, and ingested external data. Requires Data Cloud and a defined data graph.

File groundingremember

Pulls from attached files and Content libraries. Useful when the answer lives in a PDF or document rather than a record field.

Apex callable groundingremember

Custom Apex invocable that returns text. Used when the grounding source is an external system or a calculation. Counts against the context window like any other resource.

Gotchas
  • Context windows have token limits. Stuffing too much grounding dilutes the relevant context and degrades the response. Pick narrow, ranked grounding.
  • Grounding does not throw an error when the source is empty. The model just generates from memory. Always design a sparse-grounding fallback in the template.
  • Stale data grounds confident wrong answers. A knowledge article that has not been updated since the product changed is worse than no article. Audit knowledge freshness.
  • Field-level security applies to grounded record data. A user without read access on a field sees the field absent from their grounded prompt. Test with different profiles.
  • Knowledge articles in draft state are not retrieved, only published ones. The same article in two languages produces two retrievable entries.

See the full Grounding entry

Grounding includes the definition, worked example, deep dive, related terms, and a quiz.