Merge fields versus hardcoded values in prompt text
Key Takeaway
In a reusable prompt template, add record-specific details as merge fields with "Insert Resource" instead of typing them in. Typed values and typed placeholder text stay exactly as written, while a merge field fills in from the record the user selects.
A prompt template is a reusable prompt, and merge fields are the placeholders that make it reusable. Typing a specific customer's name, title or company into the prompt is called hardcoding. Instead of hardcoding, you insert a merge field. Prompt Builder replaces the merge field with real Salesforce record data each time the template runs, so one template can serve any customer.
Hardcoded values versus merge fields
Suppose you type a sender's name, a recipient's name and a city into a prompt. Those hardcoded values make the prompt work for only that one sender and that one recipient. A prompt you use once can live with that limit. A prompt template, however, is meant to work for any sender and recipient, so record-specific details should come from merge fields.
Merge fields connect a prompt template to Salesforce record fields, such as fields on sales or service records. A merge field acts like a placeholder in the prompt text.
During prompt resolution, real data replaces the merge fields before the prompt goes to the LLM. Unlike hardcoded text, which never changes, a merge field fills in from the specific records the user selects. The LLM then writes with up-to-the-minute data, and each output reflects the selected record.
Merge fields ground a template with CRM data. You create the template once and generate many personalized versions for different audiences. The output stays data-driven and consistent at scale.
Sensitive data, such as personally identifiable information, stays in Salesforce and isn't shared with the LLM. The zero-retention agreement in the Einstein Trust Layer ensures that anything shared with the LLM isn't stored or used for training.