Step-by-Step Guide to Using Flow Merge Fields in Prompt Template

This guide is part of our series on “Mastering Agentforce”.

To explore the complete series, please click here.

To enhance the effectiveness of prompt templates in Salesforce, it’s important to make them context-aware, allowing AI models to deliver better results. One way to do this is by using merge fields to pull relevant data from your Salesforce org. This gives the AI the necessary context to generate more accurate and meaningful responses.

Salesforce Prompt Builder lets you use merge fields from different sources, including:

  1. Record Merge Fileds
  2. Related List Merge Fields
  3. Flow Merge Fields
  4. Apex Merge Fields
  5. Data Cloud DMO Merge Fields
  6. Record Snapshot Merge Fields

In this guide, we’ll focus on using Flow Merge Fields in a prompt template.

Business Use Case: Proactively Managing Opportunity Risks with AI

Imagine you’re a sales rep managing multiple accounts, each with its own open opportunities and ongoing cases. Keeping track of everything can be challenging. Now, what if you had an AI assistant that could analyze these cases and opportunities, flagging any risks that might affect your deals?

That’s exactly what we aim to do here. By using Flow, we can filter down to only the open cases and opportunities related to a specific account. This data is then fed into the AI, prompting it to assess whether any open cases could negatively impact ongoing opportunities.

For instance, let’s say you’re about to close a deal with a customer for a large order of mobile generators. But there’s also a high-priority case open from the same customer regarding issues with a generator they previously purchased. This could signal a potential risk – the customer might be hesitant to make another purchase if they’re not satisfied with their existing product and/or your service.

Screenshot of Using Flow Merge Fields in Prompt Template Output

Note: For this same business use case, we have also created a Step-by-Step Guide using Apex Merge Fields.

Benefits for Sales Reps and the Business:

  • Proactive Risk Management: Spot potential deal-breakers early, allowing you to address concerns and increase your chances of closing deals.
  • Improved Customer Relationships: Show customers that you’re aware of their concerns, building trust and loyalty.
  • Increased Sales Efficiency: Focus on the most promising opportunities, saving time and resources.
  • Enhanced Decision-Making: Gain insights into account health, leading to more informed sales strategies and forecasts.

Where to Use Flow Merge Fields?

  1. Flow Merge Fields are ideal when you need to retrieve specific data based on filter conditions. In situations where using “Related List” merge fields would pull in too many records (creating unnecessary noise for the AI), Flow is a better option.
  2. It’s also useful for retrieving data from multiple objects based on complex logic or
  3. When pulling data from external systems using an HTTP Callout action in Flows.

Step-by-Step Guide: Using Flow Merge Fields in Prompt Template

In this guide, we will walk through how to use Flow Merge Fields to analyze open Cases and Opportunities for an Account, focusing on how open cases may impact opportunities. We will make use of Template-Triggered Prompt Flow, a new type of Flow that Salesforce has introduced specifically for this purpose.

This process is simple and should take 20-30 minutes to configure and test. Here’s what the guide covers:

  1. Sign Up & Set Up Einstein Generative AI Trial Org
  2. Create Flows to Get Open Cases & Opportunities
  3. Create Prompt Template
  4. Create Agent Custom Action
  5. Assign Custom Action to Einstein Copilot Agent
  6. Test Prompt Template with Einstein Copilot Agent

In the overall flow of Agentforce, the following diagram highlights the key components that we will cover in this guide.

Flow Overview - Flow Merge Fields in Prompt Template

NOTE: Certain sections of the guide will appear as locked in the free preview. You can download the unlocked version of the guide in PDF format by subscribing to our “All Access” Pass through the link below.

Not an “All Access” Pass Member Yet?

Get Download Access to this & 150+ More Step-by-Step Guides with “All Access” Pass. A simple and single plan to access our entire library of courses, guides, workshops & masterclasses on Salesforce.

Unlock the Power of Salesforce Generative AI: Master Agentforce!

Discover how to leverage Salesforce’s cutting-edge Generative AI tools to streamline your workflows and boost productivity.

Our comprehensive guides and hands-on workshops will take you from beginner to expert in no time. Learn the ins and outs of Agentforce, Agents, Topics, Actions and Prompt Builder with step-by-step tutorials, best practices, and real-world examples.

We also offer live onsite/online training for Salesforce partners, as well as consulting and implementation services for Salesforce customers.

Conclusion

Incorporating Flow Merge Fields into your prompt templates is a powerful way to enhance the relevance and actionability of AI-driven insights. By tailoring data inputs based on specific conditions, you improve the accuracy of the AI’s recommendations, ultimately empowering your users.

References & Useful URLs

1 thought on “Step-by-Step Guide to Using Flow Merge Fields in Prompt Template”

  1. Pingback: 20 Most Popular Salesforce Admin & Developer Blogs 2024 | Salesforce Ben

Comments are closed.

Scroll to Top