---
schema_version: "1"
id: d613c530af17896a2d62265bcf75ccfd1771c4afce1232d8c93541ee416c10ed
title: Add Data Graphs to a Sales Email Prompt Template
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ai/264-0-0/prompt_builder_add_data_graphs_sales_email.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.prompt_builder_add_data_graphs_sales_email.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 619960c79f87767ce22c7791122b8ba6aa02f8f4f29c28634576fe13af044485
description: Create and preview an example sales email prompt template that uses data graphs.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Add Data Graphs to a Sales Email Prompt Template

Create and preview an example sales email prompt template that uses data graphs.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions with the Einstein for Platform, or Einstein or Agentforce for Sales or Service add-on, or Agentforce Foundations</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d134583e69">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d134583e69 ">To create and manage prompt templates in Prompt Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d134583e69 ">
              <p>Prompt Template Manager permission set</p>
              <ul>
                <li>Manage Prompt Templates</li>

                <li>Execute Prompt Templates</li>

              </ul>
              <p>OR</p>
              <p style="margin-bottom:0;">Customize Application permission set</p>
            </td>

          </tr>
        </tbody>
      </table>

This topic walks through the steps to create and preview a sales email prompt template. It uses a data graph to generate an email that introduces the new account owner to the contact.

1. To create a data graph, start by establishing a data stream using the Contact object. See [Create a Salesforce CRM Data Stream](https://help.salesforce.com/s/articleView?language=en_US&id=sf.c360_a_create_crm_data_stream.htm&type=5).
2. After the data stream is deployed, map the Contact object to an Individual DMO. See [Map Data Model Objects](https://help.salesforce.com/s/articleView?id=data.c360_a_map_custom_data_model_objects.htm&type=5&language=en_US).
3. Create a data graph to work with your Sales Email template.
    1. From the App Launcher, search for and select **Data Graphs**.
    2. Click **New**, and click **Start from Scratch**.
    3. Choose a near real-time data graph or a real-time data graph.
    4. For Data Graph Name, enter Contact Overview.
    5. For the primary data model object, select **Individual** and select or enter a value for the remaining property fields.
    6. Click **Next**.
    7. Build a data graph that gets account information. See [Create a Data Graph](https://help.salesforce.com/s/articleView?id=data.c360_a_create_a_data_graph.htm&type=5&language=en_US).
4. When the data graph is active, let’s use an example prompt template that uses merge fields and your new data graph to incorporate account data into an introduction email. In Prompt Builder, create a prompt template.
    1. In the Prompt Template Type dropdown, select **Sales Email**.
    2. For the Prompt Template Name, enter Introduction Email.
    3. For the Recipient, select **Contact**.
    4. Click **Next**, and you’re redirected to the Prompt Template Workspace.
5. In the [Example Prompt Template Library](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_example_library.htm&type=5&language=en_US), find the sales email prompt template “Draft an Introduction Email to the Account Contact.” Copy and paste this template into the Prompt Template Workspace.
6. Save your work.
7. Before you run this template in Prompt Builder, in the Prompt section, use the Resources field to replace the placeholders with real merge fields. Then, add a reference to the Contact Overview data graph that you created.
    1. In the Prompt section, delete the placeholder <Get\_Detailed\_Account\_Data\_DataGraph.
    2. Click the **Resources** search bar, select **Account** and select **Data Graphs**.
    3. To add the data graph to your template, select **Contact Overview**.
8. Run the prompt template and see the LLM-generated email draft.
    1. Click the Preview Settings button.
    2. Under Inputs, search for and select a contact name in the Contact search bar.
    3. In the Configure Response and Display sections, verify that Generate Response, Display Prompt, and Display Resolution are selected or deselected based on what you want to test.
    4. Click **Save & Preview**. Review the response.