---
schema_version: "1"
id: 438aaf7ad352d115585a0dfd8910d0f1fa0df1e0c2fd57f38b6d1d9bf4b08e89
title: Add Flow Merge Fields with Data 360 Objects 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_flows_with_data_cloud_sales_email.md
canonical_url: https://help.salesforce.com/s/articleView?id=ai.prompt_builder_add_flows_with_data_cloud_sales_email.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: d06b9ef9ced3d2cbe5b217f29d5c64c5051d9089cc1b8128ef4735d9471e7167
description: Create and preview an example sales email prompt template that uses a flow with Data 360 objects.
products:
  - Agentforce
  - Cross Cloud
release: "264"
---
# Add Flow Merge Fields with Data 360 Objects to a Sales Email Prompt Template

Create and preview an example sales email prompt template that uses a flow with Data 360 objects.

### 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="d221743e63">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d221743e63 ">To create and manage prompt templates in Prompt Builder:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d221743e63 ">
              <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>

Say you’re a Salesforce admin, and your sales team requests an easier way to send emails to contacts about nearby Marketing events.

Your sales team wants to use Data 360 data to get information about each contact’s location. By using Data 360 data, you can use information that was consolidated across multiple data sources. This information can be more up to date than the contact record alone. To learn more about data consolidation, see [Unify Source Profiles](https://help.salesforce.com/s/articleView?id=data.c360_a_identity_resolution.htm&type=5&language=en_US). This example uses the standard data bundles for the Salesforce CRM connector. Your Data 360 setup, objects, and fields can differ.

You create an email prompt template that launches a prompt template flow to get Marketing events in the same city and state as your contact. You use a flow to get a list of events and their locations for the LLM. In Flow Builder, the flow looks like this.

![Flow builder view](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ai-generative_ai-264-0-0-production-enus/f8ef6498-d7b2-44e3-9b34-ffd5a850aae9/generative_ai/images/prompt_builder_add_flows_with_data_cloud_sales_email.png)

1. Turn on Einstein.
    1. From Setup, in the Quick Find box, enter Einstein Setup, and then click **Einstein Setup**.
    2. Turn on Einstein.
2. Create the flow.
    1. From Setup, in the Quick Find box, enter Flows, and then click **Flows**.
    2. Click **New Flow**.
    3. From Flow Builder, select **Template-Triggered Prompt Flow**, and then click **Create**.
3. Configure the flow.
    1. For Prompt Template Type Capability, select **Sales Email Template Capability**.
        
        A capability makes it possible to pass data between the flow and the prompt template. When you create a prompt template in Prompt Builder, you select its prompt template type.
    2. For Recipient, select **Contact**.
4. Add a Get Records element. This Get Records element retrieves contact information.
    1. For Label, enter Get Contact Info.
    2. For Data Source, select **Salesforce Object**.
    3. For Object, select **Contact**.
    4. For Condition Requirements, select **None—Get All Contact Records**.
    5. For How Many Records to Store, click **Only the first record**.
5. Add another Get Records element. This Get Records element finds the unified individual data from Data Cloud that matches the contact information.
    1. For Label, enter Get Unified Individual.
    2. For Data Source, select **Data Cloud Object**.
    3. For Data Space, select the data space you want to use, for example **default**.
    4. For Object, select your unified individual data model object (DMO), for example **Unified Individual 0000**.
    5. For Condition Requirements, select **All Conditions Are Met (AND)**.
    6. For Field, select the field that represents the contact’s first name, for example **ssot\_FirstName\_\_c**.
    7. For Operator, select **Equals**.
    8. For Value, select **{!Get\_Contact\_Info.FirstName}**.
    9. Click **Add Condition**.
    10. For Field, select the field that represents the contact’s last name, for example **ssot\_LastName\_\_c**.
    11. For Operator, select **Equals**.
    12. For Value, select **{!Get\_Contact\_Info.LastName}**.
    13. Click **Add Condition**.
    14. For Field, select the field that represents the contact’s birth date, for example **ssot\_BirthDate\_\_c**.
    15. For Operator, select **Equals**.
    16. For Value, select **{!Get\_Contact\_Info.Birthdate}**.
    17. For How Many Records to Store, click **Only the first record**.
6. Add a third Get Records element. This Get Records element retrieves the unified individual’s contact information.
    1. For Label, enter Get Unified Individual Contact Address.
    2. For Data Source, select **Data Cloud Object**.
    3. For Data Space, select the same data space as before.
    4. For Object, select your unified individual contact point address DMO, for example **Unified Indv Contact Point Address 0000**.
    5. For Condition Requirements, select **All Conditions Are Met (AND)**.
    6. For Field, select **ssot\_Id\_\_c**.
    7. For Operator, select **Equals**.
    8. For Value, select **{!Get\_Unified\_Individual.ssot\_\_Id\_\_c}**.
    9. For How Many Records to Store, click **Only the first record**.
7. Finally, add a fourth Get Records element to get event data.
    1. For Label, enter Get Events.
    2. For Object, select **Event**.
    3. For Condition Requirements, select **All Conditions Are Met (AND)**.
    4. For Field, select **IsArchived**.
    5. For Operator, select **Equals**.
    6. For Value, select **$GlobalConstant.False**.
    7. Click **Add Condition**.
    8. For Field, select **Location**.
    9. For Operator, select **Contains**.
    10. For Value, select **{!Get\_Unified\_Individual\_Contact\_Address.ssot\_\_CityId\_\_c}**.
    11. Click **Add Condition**.
    12. For Field, select **Location**.
    13. For Operator, select **Contains**.
    14. For Value, select **{!Get\_Unified\_Individual\_Contact\_Address.ssot\_\_StateProvinceId\_\_c}**.
    15. For How Many Records to Store, click **All Records**.
8. Add the Decision element.
    1. For Label, enter Any Events?
    2. On New Outcome, for Label, enter Yes.
    3. For Condition Requirements to Execute Outcome, select **All Conditions Are Met (AND)**.
    4. For Resource, select **Events from Get\_Events**.
    5. For Operator, select **Is Null**.
    6. For Value, select **$GlobalConstant.False**.
    7. Click **Default Outcome**.
    8. For Label, delete the text, and enter No.
9. For the No outcome path, add the Create Prompt Instructions element.
    1. For Label, enter No Events.
    2. For Prompt Instructions, enter No upcoming Marketing events near you.
10. For the Yes outcome path, add the Loop element.
    1. For Label, enter Add Events.
    2. For Collection Variable, select **Events from Get Events**.
11. On the For Each path, add the Prompt Instructions element.
    1. For Label, enter Add Event Details to Prompt Template.
    2. For Prompt Instructions, enter: Event details: {!Add\_Events.Subject}, {!Add\_Events.Description}, {!Add\_Events.Location}, Start Time: {!Add\_Events.StartDateTime}.
12. Click **Save**.
13. For Flow Label, enter Marketing Events Summary.
14. Save your changes, and click **Activate**.

Now, you can insert the prompt template flow into the sales email prompt template “Draft an email for a contact about regional marketing events” from the [Example Prompt Template Library](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_example_library.htm&release=264.0.0&type=5 "This library of example prompt templates gives you a starting point for creating your own custom prompt templates."). For a step-by-step guide to adding a prompt template flow to a sales email prompt template, see [Add Flows Without Data 360 Objects to a Sales Email Prompt Template](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_add_flows_without_data_cloud_sales_email.htm&release=264.0.0&type=5 "Create and preview an example sales email prompt template that uses a flow.").