Sub topic 3
Choosing the Right Prompt Template Type
Assume you understand Salesforce objects, records, fields, relationships, Lightning Experience, and basic prompts. Einstein generative AI must also be enabled in the org.
Match the Template to the Output
Choose the template type based on where the result will appear and what starts the request.
| Scenario | Template type | Typical output |
|---|---|---|
| Draft an email for a contact | Sales Email | Email text |
| Fill one field from record data | Field Generation | Field value |
| Explain a record to a user | Record Summary | Summary |
| Combine flexible inputs | Flex | Text for an automation, flow, or custom use |
For example, use a Sales Email template when a seller needs a follow-up message. Use a Field Generation template when an account needs a short description stored in a field. Use a Flex template when the inputs may come from different records or from a flow.
Trust Layer and Model Selection
Prompt Builder sends template requests through the Einstein Trust Layer. The layer helps apply Salesforce security and data-protection controls before information is sent to a supported model. Review the model’s capabilities, limits, latency, cost, and data-handling requirements before selecting it. A larger model may produce better prose but can take longer or cost more.
Preview, Test, and Version
Preview a template with representative record data before activation. Check whether merge fields resolve, instructions are followed, missing values are handled safely, and the result fits its destination.
Create a new version when changing instructions. Compare outputs against the previous version using the same records. Keep the older version available until the new one passes review.
Summarize this case in three bullet points: problem, attempted solution, and next step.
Subject: {!$Input:Case.Subject}
Description: {!$Input:Case.Description}Activate and Invoke
Activation makes a template available to its supported Salesforce entry point. Depending on the type, users may invoke it from a record page, an email composer, a field-generation action, Flow, or another supported automation path. Confirm that the invoking user has access to the template and its referenced data.
Design Practices and Common Pitfalls
- State the audience, format, length, and desired tone.
- Ground the request with only relevant fields and resources.
- Tell the model what to do when a value is blank. Do not invite guesses.
- Avoid instructions that conflict with the destination’s limits.
- Test sensitive, empty, unusually long, and multilingual data.
- Review generated text before allowing it to reach customers automatically.
Exercise
A flow receives a Case record and a customer preference string, then needs a short internal summary. Which template type fits best?
Show answer
A Flex template fits because it can accept the Case record and an additional flexible input.