Skip to content

Bonus Exercise - Create a Field Generation Template

In this exercise, you’ll use a Field Generation template to automatically generate a Storefront Overview for Pronto storefronts. You’ll ground the template using merge fields from the Storefront__c record.

Step 1: Enable Einstein

TIP

If you have already enabled Einstein Generative AI you can skip to Step 2.

  1. Open the Setup Menu and click Setup.
  2. In the Setup Quick Find, search for Generative AI, and select Einstein Setup.
  3. Click the Turn on Einstein toggle.

Step 2: Create the Field Generation template

  1. In the Setup Quick Find, search for Prompt Builder, and select Prompt Builder.
  2. Click the New Prompt Template button.
  3. Configure the prompt template as follows:
FieldValue
Prompt Template TypeField Generation
Prompt Template NameGenerate Storefront Overview
API NameKeep default
Template DescriptionThis template is used to generate a short, on-brand overview for a Pronto storefront.
ObjectStorefront
Object FieldStorefront Overview
  1. Click Next.
  2. Paste the following text in the Prompt Template Workspace:
You write short, accurate storefront overviews for Pronto’s merchant listings.
Write a storefront overview based only on the information provided.

Requirements:
1. 80–120 words
2. Clear and factual (avoid invented claims)
3. Customer-friendly tone
4. Mention cuisine and storefront type when available
5. Mention key menu themes when available

Storefront name: STOREFRONT_NAME
Cuisine: CUISINE
Type: STOREFRONT_TYPE
Address: STOREFRONT_ADDRESS
Current Storefront Overview: STOREFRONT_OVERVIEW
  1. Replace the placeholders below with the corresponding merge fields (click the Insert Resource button to access merge fields):
PlaceholderMerge field
STOREFRONT_NAMEStorefront > Storefront Name
CUISINEStorefront > Cuisine
STOREFRONT_TYPEStorefront > Type
STOREFRONT_ADDRESSStorefront > Address
STOREFRONT_OVERVIEWStorefront > Storefront Overview
  1. Click the Preview Settings Button and select any storefront record (for example, Fusion Bites or another storefront provided in your org) as the Related Record.
    Image
  2. Click on Save & Preview to run the prompt template.
    Image
  3. In the Resolved Prompt panel (center), examine the prompt that was generated. Notice that the merge fields have been replaced with the actual values for your storefront record.
  4. In the Generated Response panel (right), examine the storefront overview that was generated by the LLM.
  5. Click on the Prompt Section and modify the template instructions. For example, change the number of words you want the generated overview to be. Click Preview again to see the results.
    TIP
    Try adding Storefront > Record Snapshot as a merge field to capture more context from related records.
  6. Click Activate when you are satisfied with your template.

Step 3: Bind the template to the Storefront Overview field

  1. Open the Merchant Management app, click the Storefronts tab, and open any storefront record.
  2. Click the Setup icon and select Edit Page.
  3. Open the Fields tab in the sidebar and drag the Storefront Overview field onto the page layout.
  4. Click the Storefront Overview field.
  5. In the right panel, select Generate Storefront Overview as the prompt template to be used to generate the storefront overview.
    Image
  6. Click Save to save your changes to the page.
  7. Click the back arrow button to leave App Builder and go back to the Storefront record.
  8. Click the Edit button next to the Storefront Overview field.
  9. Click the Generate button (sparkles icon) next to the Storefront Overview input field, and watch Einstein generate a storefront overview.
  10. Click Use to move the generated overview to the Storefront Overview field.
    Image
  11. Click Save to save the record.

This concludes the Bonus Exercise.

Released under the MIT License.