How to Use Agentforce Prompt Template: Field Generation Type

April 17, 2025


 

 

After completing this unit, you will able to:


Introduction

In this blog, We will explore about the Agentforce Prompt template use cases and how to use prompt tempates to make tasks easy. let's get started.

 

🔍 What is a Prompt Template in Salesforce?

A Prompt Template in Salesforce is a reusable AI instruction pattern that tells the generative AI (like Einstein GPT or Agentforce) what to do, what data to use, and how to respond.

It acts as a blueprint that:

🧠 Why Are Prompt Templates Important?

With Salesforce integrating more deeply with generative AI tools, you don’t want every user or developer writing their own prompts from scratch. Templates help by:

 

🔄 Types of Prompt Templates

 

Create a Developer Edition Org with Special Configuration:

https://trailhead.salesforce.com/promo/orgs/earn-the-prompt-builder-templates-superbadge-unit

 

How to Create Field Generation Prompt Template

Before creating template we need to enable some configuration to make it available prompt template in salesforce org.

  1. Click on Setup and Search in Quick Find box Einstein Setup
  2. Click on Einstein Setup 
  3. Turn on the Turn on Einstein radio button
  4. Refresh the browser tab

Build an AI-Generated Summary of Related Records

  1. Create a custom field on Contact called Interest Summary (with the API name Interest_Summary__c)
  2. Click on Setup and Search in Quick Find box Prompt Builder
  3. Click on New Prompt Template

  4. Choose Prompt Template Type Field Generation
  5. Prompt Template Name Summarize Client Goals
  6. API Name will remain as it is
  7. Template Description Same as Prompt Template Name
  8. Select Object as Contact and object field as Interest Summary
  9. Click on Next Button
  10. In the Prompt Template Workspace Write below text:
    You are a wellness coach from a company called Tranquil Trails who wants to see a quick summary of a client's fitness interests.
    Review the content in the list of fitness records related to a contact record, [Related list of all Fitness records]
    In this list all records relate to the individual contact.
    Fitness records: [Related list of all Fitness records]
    Contact name: [Input the contact's first name]
    Instructions: """
    Follow these instructions precisely. Don’t add any information not provided.
    The "contact" must be referred to as a "client" in the summary.
    Use clear, concise, and straightforward language in the active voice and a friendly, informal, informative tone.
    The summary must include the following:
    Use the client's first name in the first sentence.
    Interpret any reported stress level based on a scale from 1-10, with values of 7-10 being ideal.
    If any values are missing, do not include any reference to missing information.
    Do not address any content or generate answers that don’t have complete data.
    Do not use filler words or phrases or redundant language.
    Use an introductory summary sentence and closing sentence in addition to several bullet points.
    When you format the list, use a variety of emoji as bullet points to add interest.
    Limit the summary to seven sentences.
    """
  11. Replace the brackets text with the relevant fields using Record input box.
  12. Select Model: OpenAI GPT 4 Turbo 
  13. Click on Save button and Activate the template
  14. Search Contact record Robinette Bullman
  15. Edit the page by clicking on gear button
  16. Click on Fields and in right side Click on Upgrade Now button
  17. Scroll down and select Interest Summary Field
  18. In the right side Prompt Template box Select your Prompt template. (If you are not able to see the template name in the Prompt Template box make sure you have activate the Prompt Template.)
  19. Click on Save button and Activate
  20. Click on the back arrow 
  21. Edit the Interest Summary field and click on Icon next to field.
  22. Eienstein Generative AI Generate the related records summary and click on Use button

Output:

 

This is an example of a Field Generation Prompt Template — I hope it helps you better understand how Agentforce Prompt Templates work.

Thanks