---
schema_version: "1"
id: 91298e10afa2297796e65e545f31aefa70c9413b7c079b3a65e0e18429f774e2
title: Add Data Sources to Enrich Field Update Suggestions in Agentforce Pipeline Management
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/sales/264-0-0/pipeline_mgmt_custom_data_sources.md
canonical_url: https://help.salesforce.com/s/articleView?id=sales.pipeline_mgmt_custom_data_sources.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 88d833220916344c1012043d0cc69048fd593994b6edc4b6ab87fd0ab9ac0421
description: Agentforce Pipeline Management can use notes, emails, or calls to inform the agent’s field update suggestions. You can customize and expand the data sources that your agent uses. For example, use other opportunity fields or different sources, such as content from other objects.
products:
  - Sales Cloud
  - Agentforce
release: "264"
---
# Add Data Sources to Enrich Field Update Suggestions in Agentforce Pipeline Management

Agentforce Pipeline Management can use notes, emails, or calls to inform the agent’s field update suggestions. You can customize and expand the data sources that your agent uses. For example, use other opportunity fields or different sources, such as content from other 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>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions with the Agentforce for Sales or Agentforce for an Industry add-on, or included in Agentforce 1 Sales or an Industry Edition. Requires each user to have the Agentforce for Sales or Agentforce for an Industry add-on to access the actions.</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="d13524e74">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d13524e74 ">To edit prompt templates:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d13524e74 ">
              <p>Prompt Template Manager Permission Set</p>
              <p>AND</p>
              <p>Manage Prompt Template</p>
              <p>AND</p>
              <p style="margin-bottom:0;">Execute Prompt Template</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d13524e74 ">To map prompt templates to Opportunity fields:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d13524e74 ">Edit access on the Opportunity object</td>

          </tr>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d13524e74 ">To create, edit, and manage flows:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d13524e74 ">Manage Flow</td>

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

## Add Opportunity Fields as Data Sources

To use other opportunity fields to inform the agent’s field update suggestions, edit the Field Generation prompt template instructions.

Before you begin, make sure that the agent has permission to access the opportunity field that you’re adding as a data source.

1. From Setup, in the Quick Find box, enter and then select **Prompt Builder**.
2. Select the Field Generation prompt template that you want to use the opportunity field as a data source for.
    
    For example, to use data from a custom opportunity field when generating field update suggestions for Next Step, select the Recommend Next Step for Opportunity prompt template.
    
    If you’re using your own prompt template, copy over the instructions from the Recommend Next Step for Opportunity prompt template. Then, adjust the instructions to reference the fields and data sources that you want. Don’t change or remove instructions about the output. The output must be in the specified JSON structure to align with the user interface. Changing the structure or snippets can result in data showing incorrectly or not at all.
3. On the prompt template, find the instructions about data sources.
    1. Click **Insert Resource**.
    2. Select the opportunity field that you want to add.
4. To make sure that you get the results you want, [test your prompt template](https://help.salesforce.com/s/articleView?language=en_US&id=ai.prompt_builder_review_revise.htm) thoroughly. Then, when you’re ready, activate it.

## Add Data Sources to the Get Opportunity Grounding Data Flow

Use data from other Salesforce objects or external objects to inform the agent’s opportunity field update suggestions.

Your data source must have an ID field that you can reference as a variable. Before you begin, confirm that the agent has permission to access the data source that you want to use.

1. From Setup, in the Quick Find box, enter and select **Flows**.
2. Select the **Get Opportunity Grounding Data** flow.
3. Above the Add Grounding Data to Prompt Instructions element, [add a new Get Records element](https://help.salesforce.com/s/articleView?id=platform.flow_ref_elements_data_get.htm&language=en_US) to retrieve information from your data source.
    
    For example, to use data from tasks, create an element called Get Tasks.
4. Assign variables to the fields that you want to use.
    1. Under How to Store Record Data, select **Choose fields and assign variables (advanced)**.
    2. Under Where to Store Field Values, select **In separate variables**.
    3. Store the record’s ID field in a variable.
        
        For example, to use data from tasks, store the Activity ID field in a variable called LatestTaskId.
    4. Store other relevant fields in variables.
        
        For example, to use data from tasks, store the Description field in a variable called LatestTaskDescription and the Subject field in a variable called LatestTaskSubject.
5. Go to the Add Grounding Data to Prompt Instructions element. [Add instructions](https://help.salesforce.com/s/articleView?language=en_US&id=platform.flow_ref_elements_add_prompt.htm) to retrieve the ID and the other fields that you’re using from the data source.
6. Save and activate the flow.
7. Go to the prompt template that you’re using to generate field update suggestions.
    
    For example, the Recommend Next Step for Opportunity prompt template or your own custom prompt template.
    
    1. Make sure that your prompt template has instructions to call the Get Opportunity Grounding Data flow as a data source.
    2. Add an instruction to extract the ID for your data source. For example, “You must strictly extract the latestTaskId for tasks.”
    3. To make sure that you get the results you want, [test your prompt template](https://help.salesforce.com/s/articleView?language=en_US&id=ai.prompt_builder_review_revise.htm) thoroughly. Then, when you’re ready, activate it.