Prompt Builder Templates Superbadge Unit
Create Prompt Builder templates to supercharge AI-powered insights and engagement.
Prompt Builder Templates Superbadge Unit
What You'll Be Doing to Earn This Superbadge
1. Use the Prompt Template Workspace to configure Flex, Field Generation, and Sales Email prompt template types.
2. Adjust an existing flow to incorporate a prompt template.
3. Send an email using an email prompt template.
Concepts Tested in This Superbadge
- Creating Prompt Templates
- Prompt Template Instructions
- Calling a Prompt Template in a Simple Flow
Sign Up for a Developer Edition Org with Special Configuration
To complete this superbadge unit, you need a special Developer Edition org that contains specific configuration and sample data. Note that this Developer Edition org is designed to work with the challenges in this superbadge unit.
-
Sign up for a free Developer Edition org with special configuration.
Fill out the form. For Email address, enter an active email address.
- After you fill out the form, click Sign me up.
When you receive the activation email (this might take a few minutes), open it and click Verify Account.
Complete your registration by setting your password and challenge question. Tip: Save your username, password, and login URL in a secure place—such as a password manager—for easy access later.
You are logged in to your superbadge Developer Edition org.
Additional Configuration
Now, connect your new Developer Edition org to Trailhead.
Make sure you’re logged in to your Trailhead account.
In the Challenge section at the bottom of this page, select Connect Org from the picklist.
On the login screen, enter the username and password for the Developer Edition org you just set up.
On the “Allow Access?” page, click Allow.
On the “Want to connect this org for hands-on challenges?” page, click Yes! Save it. You are redirected back to the Challenge page and ready to use your new Developer Edition org to earn this superbadge.
Now that you have a Salesforce org with special configuration for this superbadge unit, you’re good to go.
Prework and Notes
Use Case
Tranquil Trails Wellness Co. (Tranquil Trails) is a leading wellness provider with a global presence. Established to promote holistic health and wellness, the company helps clients meet their fitness goals by connecting them with personal wellness coaches for guidance and encouragement. Tranquil Trails wants to incorporate new artificial intelligence (AI)-driven features to help the coaches better engage with clients, creating more personalized interactions at scale.
As a Salesforce Administrator for Tranquil Trails, your task is to complete the necessary steps to achieve the company’s goals with the Salesforce Platform. The company is focusing on improving the client experience by collecting clients’ feedback about their goals and recent activities. Tranquil Trails will use this feedback to provide personalized suggestions to clients and ensure that all coaches are aware of their clients’ evolving needs and objectives.
Business Requirements
Translate Text with a Prompt Template and Record-Triggered Flow
Tranquil Trails offers a “goals and interests” survey in a client portal. Clients complete their first survey before they begin working with a coach and may have several form submissions over time. Each survey submission creates a new record in the Tranquil Trails Salesforce instance in a custom object called Fitness. A field called Survey Input captures comments in a variety of languages.
While clients are always assigned a coach who speaks their language, some managers only speak English. Managers need to be able to read the comments in English, even if the client originally entered the content in a different language. Your job is to configure a feature that automatically translates the survey comments into English and updates a field called Translated Survey Input with the AI-generated translation.
Create a new prompt template named Translate Survey Input
with description text reflecting the purpose of the template. For now, the prompt template will only reference the Fitness object, but the team wants the template to be able to incorporate resources from the Account and Contact objects in the future. Make sure the template can include references to the Account and Contact objects and the Fitness object. The Template Inputs should include the three source objects associated with the following fields and API Names.
Account
with API name AccountContact
with API name ContactFitness
with API name FitnessRefer to the prompt text. Replace the text found in brackets with the appropriate resource. Make sure Einstein Generative AI is enabled in your org and that the template uses the Standard Model Type with the OpenAI GPT 4 Turbo model.
Preview the translation capability in the Prompt Template Workspace using Kyrstin Strong's account and contact records and Fitness Interest-0906. Make sure the prompt template is ready for use in the system: your next step is to automate the translation service. Any new records that are created in the system should automatically form with survey input translated per the prompt template. An existing flow called Translate Fitness Survey Input is partially built. The flow already has a Start element and two Get Records elements.
Update the flow to ensure that the language translation feature runs whenever a new survey record is created. Add a new Action element immediately after the existing Get Records elements called Translate Survey Input
. This action calls the Translate Survey Input prompt template you created. Use any description you’d like; we won't check for the element description. Do not manually assign variables; rather allow the system to automatically store the response from the action.
Configure the input values for the action using the following values.
Add an Update Records element called Update Translated Survey Input
that will update the record that started the flow, using any description you’d like. Use the Fitness record that triggered the flow. Set the field value for Translated_Survey_Input__c with the value output from the prior action {!Translate_Survey_Input.promptResponse}.
Make sure the flow is ready for use after adding the action and element. Test the flow using a sample Fitness record you manually create for Latisha Bryce from her contact record. For testing purposes, include the following information and any other record details you’d like to include. (We won’t check for other details.) In the Survey Input field, enter the Italian phrase Ho sempre desiderato correre una maratona.
And for the Interest Type, enter Running
.
Your automations do their work when you save the record! Review the translated text to confirm that the model is translating Latisha’s interest in running a marathon into English. It's amazing to see the translation run without having to configure any specific translation rules, and program managers and coaches are big fans of the new functionality.
Build an AI-Generated Summary of Related Records
The Tranquil Trails marketing team wants to use AI to create personalized profile insights for their clients based on clients' surveys. Over time clients may have several different interests or concerns. Each survey submission creates a new Fitness record in Salesforce related to a client’s Contact record. Each client can have several related Fitness records. Rather than reviewing each related record, wellness coaches want to see a summary of all Fitness submissions a client has provided right on the Contact record page.
Your strategy is to create a custom rich text field on the Contact record that will hold an AI-generated summary of all related Fitness records. Create a custom field on Contact called Interest Summary
(with the API name Interest_Summary__c), using any description and help text you’d like.
Create a new prompt template called Summarize Client Goals
that will generate text for the new summary field, with description text reflecting the purpose of the template.
Tip: If you can’t find the field you just created, make sure you’ve read the Help article and followed the Additional Configuration step about Session Settings.
Enter the text provided by the marketing team in the Prompt Template Workspace, making sure to replace the text in brackets with the appropriate Resources. You can use any LLM model you’d like; we recommend using OpenAI GPT 4 Turbo, but we won’t check for that.
After you preview the response to confirm the model runs as expected, make sure it is ready for use in the system. Update the Contact record page so that users can run the prompt from the new custom field. Finally, test the feature using the contact record for Robinette Bullman by generating an interest summary with the field you configured as the summary destination.
Create a Prompt Template for an Engagement Email
The team is thrilled that these new templates and automations are in place to summarize and localize client information! Now, Tranquil Trails wants to help wellness coaches easily create engaging, personalized emails that encourage clients to keep working toward their wellness goals. Rather than having coaches sort through interest and program records manually, the team wants the system to be able to compare client information with currently available programs and suggest activities and offerings that align with client interests.
Create a prompt template namedProgram Recommendation Email
with description text reflecting the purpose of the template. When you define the template, specify the Contact object for the Recipient; do not configure a Related Object. The template will reference information from the client’s interests and preferences to generate a personalized email.
The template will also reference an Apex class already available in the Tranquil Trails system called Prompt_Program_Recommendation_Invocable. This Apex class uses just a few lines of code to generate personalized program suggestions dynamically, informed by a client’s specific fitness interests.
Use the following instructions in the Prompt Template Workspace.
Preview the response to confirm that the model runs as expected and confirm that the prompt template is ready for use in the system. Make sure that wellness coach Victoria Bryant can select the Draft with Einstein feature in the native email activity. Test the feature as a user would by sending an email to Robinette Bullman using the Program Recommendation Email template. You do not need to log in as Victoria to test the feature.
Tip: Navigating to the Tranquil Trails app may be the most convenient way to send an email from the contact record. You may want to adjust the contact email for Robinette to your own for testing purposes.
Tip: If you're not seeing the custom “pre-made instructions” referencing the template you just created, make sure the prompt template is ready for use in the system, review the note about Session Settings, then try refreshing the page.
Remind anyone who works with the generated output that all content must be reviewed before it goes to clients. While it is possible for LLMs to give incorrect or unsuitable responses, the Einstein Trust Layer works to prevent the use of biased, noninclusive, or discriminatory language. However, checks by coaches sending the emails are still important to guarantee that everything is working as planned.
After your successful test, it's time to share the results with the marketing and sales teams to demonstrate the features Prompt Builder offers. They can already tell that they will save countless hours previously spent manually sifting through client surveys and program offerings and drafting individual emails. Most exciting: The new features don’t just summarize or combine information; rather, client information is synthesized into highly customized and tailored suggestions. The teams can’t wait for you to roll out more AI-powered features.