Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Get to Know Prompt Builder

Learning Objectives

After completing this unit, you’ll be able to:

  • Explain the purpose and value of Prompt Builder.
  • List some use cases supported by standard prompt templates.

Meet Prompt Builder

If you’ve checked out the Prompt Fundamentals module, you know that generative AI can simplify how you perform your daily workflows. You also know that for generative AI to be effective, you need well-formulated prompts to create relevant, trusted content. And you learned that you can scale the effort that goes into creating individual prompts by creating prompt templates.

With Prompt Builder, you create, test, revise, customize, and manage prompt templates that can make use of your CRM data. And in turn, these templates make your user’s daily workflows easier and your business smarter.

Prompt Builder embeds generative AI experiences into the workflows of your users, enabling a variety of assistive use cases across both desktop and mobile. Would it save time for your sales team if they could auto-generate lead emails? Would sales also appreciate being able to quickly assess what open and escalated cases their customers are dealing with before they get on a call with a key executive? For these examples and more, Prompt Builder is here to help.

Prompt Builder Features

Prompt Builder incorporates all the ingredients that make a prompt template great: instructions, participants, context, goals, relationships, constraints, and, most importantly, your CRM data.

When you use data from Salesforce record fields, such as from your product or contact records, your generative AI output is truly personalized and speaks specifically to your business and your customers. A large language model (LLM) is only as smart as the data it’s trained with, so Prompt Builder lets you give it more power by putting your data front and center.

You can also use Flow Builder with Prompt Builder to include flows in your templates, creating dynamic prompts that go way beyond linking record fields. Flows let you add conditional logic to a prompt, so you include exactly the data you need. For example, use a flow to add data based on the output of a decision tree.

Prompt Builder also gives you a workspace to test your prompt templates. Instantly view LLM-generated responses for the records you select. Revise and iterate on your prompt template until it consistently provides effective results.

Let’s look at a couple of types of templates you can create and provide to your users with Prompt Builder.

Email Generation

Does your business regularly need to contact customers with enticing cold emails, captivating product introductions, or exciting sales promotions? Wouldn’t it be nice if you could get an LLM to write those emails for you, while using your customer relationship history and insights?

[AI-generated image using DreamStudio at stability.ai with the prompt, ”Multiple laptops with several emails getting sent in different directions. Drawn in the style of 2D vector art.”]

Linda Rosenberg, a Salesforce admin for Cloud Kicks, learns that her company’s sales team spends a significant amount of time writing lead generation emails. Linda turns to Prompt Builder to make email workflows easier for her salespeople.

When designing her email prompt template, Linda understands that personalizing the output is key. She wants to make sure the LLM generates a response based on her company’s actual business context. So she uses Prompt Builder to include merge fields that use Salesforce CRM data in her template. She starts drafting the prompt template.

You are a {!$Input:Sender.Title} and your name is {!$Input:Sender.FirstName} from the organization {!$Input:Sender.CompanyName}. Your prospect is {!$Input:Recipient.Name}, a {!$Input:Recipient.Title} from {!$Input:Recipient.Company}, and they are based in {!$Input:Recipient.City}.

Using Flow Builder, Linda also adds a flow to the template that cross-references clients’ locations to discover local events hosted by Cloud Kicks. If a nearby event isn’t found, the flow suggests an upcoming online event instead. Linda incorporates the flow in her prompt template, so that after the flow runs and the event is identified, the LLM uses the flow’s output to generate an email containing events for the client to attend. She continues her prompt template and adds the following instruction.

In the email, invite the prospect to attend the event {!$FLOW:Check_Events_In_Lead Area.Prompt} in no more than 90 words. Explain to the prospect possible benefits for attending the event and mention that you would be happy to chat with them further at the event or online if they need more information.

Linda finishes creating the prompt template and selects a record to test it on. She sees the generated prompt and the email that the LLM produces as output. Linda can refine the prompt once it’s created.

Prompt 

Output 

You are a sales manager and your name is Jose Figueroa from the organization Cloud Kicks. Your prospect is Rob Hutchinson, a director from Acme Inc., and they are based in Atlanta, Georgia.

When I ask you to generate an email inviting the prospect to your company's event, you must strictly follow my instructions below.

In the email, invite the prospect to attend the event “Floating on Clouds: Atlanta Kickoff” on September 18, 2023, an event for customers of Cloud Kicks new and old to network and preview upcoming products, in no more than 90 words. Explain to the prospect possible benefits for attending the event and mention that you would be happy to chat with them further at the event or online if they need more information.

The salutation must only have the recipient's name. Additionally, generate a subject line that can increase open rate using words and content that is related to the email body content. It must be no more than 12 words.

Use clear, concise, and straightforward language using the active voice and strictly avoiding the use of filler words and phrases and redundant language.

Now, generate the email inviting your prospect to the event.

Subject: Join us at “Floating on Clouds: Atlanta Kickoff” on September 18, 2023!

Hi Rob,

You’re invited to attend “Floating on Clouds: Atlanta Kickoff” on September 18, 2023, an exclusive event for Cloud Kicks customers, new and old. This event is a fantastic opportunity to network with industry leaders and get a sneak peek at our upcoming products. We believe attending this event will provide valuable insights and connections. If you’d like more information, I’d be delighted to chat with you at the event or online.

Looking forward to seeing you there!

Best regards,

Jose Figueroa

Sales Manager

Cloud Kicks

Linda reviews the output and decides that the template is ready. She also confirms that her colleagues know to always review the responses they get to ensure they’re relevant and unbiased and are aware that they can customize responses as desired.

Field Generation

Field generation brings AI-created content directly to the Lightning Experience fields on desktop or mobile that you use the most. Field generation can save time on repeated tasks, such as using an LLM to write product descriptions. But it can also do much more, setting your business up for new opportunities that weren’t previously possible.

For example, Linda from Cloud Kicks knows that the sales team has been caught unaware of open issues when on customer calls. Especially if there is an escalated case, sales wants to know about it. Management has suggested that support provides up-to-the-minute summaries of customer cases to the sales team before calls, but this hasn’t been feasible.

Linda realizes that field generation templates can integrate with Flow Builder and obtain the case data for an LLM to summarize. She gets to work with the same thoughtful process of creation, testing, and iteration that she used with her email generation template. After some experimentation, Linda has the following field generation prompt template.

You are a support representative who is tasked with creating a short summary of all the open cases for a given customer to be used by a salesperson about to get on a call with a customer.

You must treat equally any individuals or persons from different socioeconomic statuses, sexual orientations, religions, races, physical appearances, nationalities, gender identities, disabilities, and ages. When you do not have sufficient information, you must choose the unknown option, rather than making assumptions based on any stereotypes.

Instructions:

""""""

Follow the instructions precisely, do not add any information not provided.

Summarize by telling the rep how many open cases there are, how many are escalated. Then summarize the escalated case issues.

Use clear, concise, and straightforward language using the active voice and strictly avoiding the use of filler words and phrases and redundant language.

Keep the emotion of the summary relaxed.

""""""

Open Cases JSON Data Graph:

{!$Flow:Ground_On_Open_Cases_For_Account.Prompt}

""""""

 

Prompt

Prompt Builder creates the following prompt from the template. Note that the prompt is largely the same as the prompt template until you get to the bottom of the text. There, the flow has been replaced with actual data.

You are a support representative who is tasked with creating a short summary of all the open cases for a given customer to be used by a salesperson about to get on a call with a customer.

You must treat equally any individuals or persons from different socioeconomic statuses, sexual orientations, religions, races, physical appearances, nationalities, gender identities, disabilities, and ages. When you do not have sufficient information, you must choose the unknown option, rather than making assumptions based on any stereotypes.

Instructions:

""""""

Follow the instructions precisely, do not add any information not provided.

Summarize by telling the rep how many open cases there are, how many are escalated. Then summarize the escalated case issues.

Use clear, concise, and straightforward language using the active voice and strictly avoiding the use of filler words and phrases and redundant language.

Keep the emotion of the summary relaxed.

""""""

Open Cases JSON Data Graph:

{'Cases':[

'00001004':{'Status':'Escalated','Subject':'Fraudulent Activity','Description':'Suspicion of fraudulent activity related to the shoe order.'},

'00001005':{'Status':'Escalated','Subject':Lost Shoe Shipment','Description':'Customer has not received the shoe shipment, and tracking information is not updating.'},

'00001006':{'Status':'Escalated','Subject':'Incorrect Shoe Style,'Description':'Customer received a different style of shoe than the customer ordered.'},

'00001007':{'Status':'On Hold','Subject':'Shoe Sole Wear and Tear','Description':'Premature wear and tear on the shoe sole reported by the customer.'},

'00001008':{'Status':'Escalated','Subject':'Delayed Shoe Delivery','Description':Customer did not receive the shoes within the expected timeframe.'},

'00001009':{'Status':'On Hold','Subject':'Damaged Shoe Box','Description':' The shoe box arrived damaged during shipping.'},

'00001010':{'Status':'Escalated','Subject':'Incorrect Shoe Size','Description':'Customer received shoes with the wrong size.'},

'00001011':{'Status':'On Hold','Subject':'Incorrect Billing','Description':'Billing information does not match the order details.'}

{}]}

""""""

 

Output 

Here’s the LLM’s response to the prompt, summarizing the data in a human-friendly form.

There are 8 open cases for this customer, with 5 of them escalated.

The escalated case issues are as follows:

- Case 00001004: Investigating potential fraud linked to the shoe order, addressing customer security concerns, and verifying transaction authenticity.

- Case 00001005: Urgently addressing a missing shoe shipment, investigating tracking issues, and ensuring timely resolution for the customer's satisfaction.

- Case 00001006: Resolving the issue where the customer received a style of shoe different from the one they ordered, ensuring accurate fulfillment.

- Case 00001008: Customer distressed due to prolonged wait for shoes, causing inconvenience and frustration. Urgent resolution needed.

- Case 00001010: Customer dissatisfied as shoes received don't match ordered size, impacting comfort and usability. Immediate attention required.

Please note that the information provided is strictly based on the open cases and does not make any assumptions or judgments about the customer.

 

Linda reviews the output and decides the template is ready to go. She meets with the sales team and makes sure they understand their responsibility to be the “human-in-the-loop” with the LLM by reviewing all its responses. Support is relieved, sales is excited, and Linda starts thinking about the next way she can use Prompt Builder to simplify workflows in supported experiences across the Customer 360.

[AI-generated image using DreamStudio at stability.ai with the prompt, ”A woman in a conference room doing a presentation with a sales team. Drawn in the style of 2D vector art.”]

Prompt Builder gives your team the freedom to concentrate on what matters most–your customers.

Resources

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback