Sub topic 11
Previewing, Testing and Versioning a Template
This chapter assumes you can open Prompt Builder in Setup, that you know what merge fields are, and that you have already built at least one template of any type. Here you will learn how to check a template before anyone relies on it, and how versions let you change a template safely.
Why test before you activate
A prompt template can look correct and still produce poor text. The usual causes are an empty field, a wrong merge field, or an instruction the model reads differently than you meant. Prompt Builder lets you see the resolved prompt and the model's response for a real record before you activate anything.
Previewing a template
The preview panel in the template editor does two things:
- It resolves the prompt. Every merge field is replaced with the value from a record you choose.
- It sends the resolved prompt to the model and shows the response.
For object-bound types (Sales Email, Field Generation, Record Summary), you pick a record of the template's object, such as a Contact or an Account. For a Flex template, you supply a value for each input you defined, such as a Case record for an input named Case.
Always read the resolved prompt first, before you read the response. If the prompt contains a blank or a raw merge field, the response will be wrong no matter how good the model is.
Using the information below, write a one-sentence description of this account for a sales rep.
Account name: {!$Input:Account.Name}
Industry: {!$Input:Account.Industry}
Annual revenue: {!$Input:Account.AnnualRevenue}
If a value is empty, leave it out instead of guessing.Preview this prompt on an account that has no Annual Revenue. The resolved prompt shows an empty value on the last line, and the final instruction should keep the response from inventing a figure. If it invents one anyway, tighten the wording.
What to test
Do not stop at one record. Try at least these cases:
| Case | What it checks |
|---|---|
| A record with complete data | The normal path works. |
| A record with empty fields | The "do not guess" instructions hold. |
| A record with long text | Long descriptions do not crowd out the instructions. |
| A user with limited access | Output depends on what that user can see. |
Model output varies between runs, so preview the same record more than once. A prompt that passes once may fail on the next run.
Versions
Each template has versions. A version is a saved snapshot of the template's prompt text, inputs and model settings. Versions let you improve a template without disturbing the one people already use.
- A new version starts as a copy of an existing one, so you edit the copy.
- Only one version of a template is active at a time.
- Inactive versions stay available for preview and comparison.
Comparing versions
A safe revision loop looks like this:
- Clone the active version to create a new draft.
- Change one thing, such as the length limit or a grounding instruction.
- Preview the draft and the active version on the same records.
- Compare the two outputs side by side.
- Activate the draft only if it is clearly better.
Changing one thing at a time matters. If you rewrite the whole prompt, you cannot tell which change caused a difference.
Common errors
- Testing with one perfect record. Real data has gaps. Include sparse records.
- Judging only the response. A blank merge field is easy to miss in the output but obvious in the resolved prompt.
- Editing the active version. Create a new version instead, so you keep a version to go back to.
- Ignoring the model setting. A different model can change tone and length, so preview again after switching.
Exercise
You changed the Case summary prompt to ask for three bullet points instead of a paragraph. List the steps you take before activating, and name the first thing you check in the preview.
Show answer
Clone the active version, make the single change, preview both versions on the same several Case records (including one with an empty Description), compare the outputs, and activate only if the new version is better. In each preview, check the resolved prompt first to confirm that the merge fields for Subject and Description were filled with real values.