---
schema_version: "1"
id: 1b658642d9fcfe8f8c8d8f44c49ce88eaedc51a7b7729cda1435404a2fc1ee82
title: Set Up Related Record Grounding for Messaging (Optional)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/sp_rrg_setup_msg.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.sp_rrg_setup_msg.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ea93e9d697bd772378d16a12dbaea1a0f24c9cffc3c2b2e8d545cf391dfaf090
description: Ground messaging service plans in related records using a prompt template.
products:
  - Service Cloud
  - Service Intelligence
release: "264"
---
# Set Up Related Record Grounding for Messaging (Optional)

Ground messaging service plans in related records using a prompt template.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <tbody>
          <tr class="">
            <td class="slds-cell-wrap" colspan="2" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.messaging_editions.htm&amp;type=5&amp;language=en_US" target="_blank">View supported editions.</a></td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span style="vertical-align:text-bottom;display:inline-block;"><img style="margin-bottom:0;" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/resources-global/_corporate/images/checkmark.png" alt="Checkmark"></span> This article applies to:
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Service Assistant for Messaging</td>

          </tr>
          <tr class="">
            <td class="slds-cell-wrap" style="vertical-align:top;">
              <span style="vertical-align:text-bottom;display:inline-block;"><img style="margin-bottom:0;" src="https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/resources-global/_corporate/images/crossmark.png" alt="X icon"></span> This article doesn't apply to:
            </td>

            <td class="slds-cell-wrap" style="vertical-align:top;">Service Assistant for Case and Voice</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="d33959e94">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d33959e94 ">To set up related record grounding for Messaging:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d33959e94 ">
              <p>Customize Application OR System Administrator</p>
              <p>AND</p>
              <p>Service Planner Builder permission set</p>
              <p>AND</p>
              <p style="margin-bottom:0;">Prompt Template Manager</p>
            </td>

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

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/images/icon_note.png)

Note This section provides the setup steps for Messaging related record grounding. Reference information is provided in [Grounding Messaging Service Plans with Related Records](https://help.salesforce.com/s/articleView?id=service.sp_rrg_msg.htm&language=en_US).

Before you set up related record grounding, confirm you have completed these tasks.

- [Set Up Service Assistant for Messaging](https://help.salesforce.com/s/articleView?id=service.sp_setup_msg.htm&language=en_US&type=5).
- Confirm your users have the required [Service Assistant for Messaging permissions](https://help.salesforce.com/s/articleView?id=service.sp_permissions_messaging.htm&language=en_US&type=5).

Related record grounding for messaging is executed through the Messaging Session Related Record Details prompt template. By default, the prompt template includes several Case and Account fields.

![Messaging Session Related Record Details default prompt template](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/service_planner/sp_rrg_msg_pt_default.png)

You can modify the template to reference additional fields or related records, such as Input:MessagingSession.Contact.FirstName, as long as the field is directly connected to the record you're grounding on. Referencing a record that's connected through another related record, such as MessagingSession.Case.Contact.FirstName, isn't supported in Prompt Builder.

## Turn On Related Record Grounding

Turn the feature on from the Service Assistant Setup page.

1. From the Service Assistant Setup page, go to the Customize Your Experience by Object section and select the **Messaging** tab.
2. Go to the Include Context from Related Records section.
3. Turn the feature on.
4. Click **Go to Prompt Template**. The Messaging Session Related Record Details grounding prompt template opens.

![Messaging related record grounding toggle](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/service_planner/sp_rrg_msg.png)

## Configure the Prompt Template

Configure the Messaging Session Related Record Details grounding prompt template to ground service plans in related records.

By default, the template includes several Case and Account fields. If you want to use the standard template, no action is required. The template is already active. Go to the next procedure.

1. From the Prompt Builder Workspace, click **Deactivate**.
2. Click **Save As** and then click **Save As New Version**.
3. Modify the template to your requirements.
4. Save your changes and activate the prompt template.

## Provide Access to Your Grounding Data

Grant the ServicePlanner User and service reps read access to the objects and fields included in your prompt template.

To include related record data in a messaging service plan, both the ServicePlanner User (agent user) and service reps require read access to all objects and fields included in the prompt template.

If you pass record data to the prompt template using input resources such as a flow or Apex action, the ServicePlanner User and service reps also require access to the fields, objects, and Apex classes that those resources reference.

We recommend providing access through a Messaging Record Grounding custom permission set. Service reps also need the Prompt Template User permission set.

The ServicePlanner User's access retrieves and passes the data into the plan, and the service rep's access lets that data appear in the service plan. Grant service reps access to the objects and fields included in your prompt template according to your data access and sharing rules.

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
          <colgroup>
            <col style="width:33.33333333333333%">
            <col style="width:33.33333333333333%">
            <col style="width:33.33333333333333%">
          </colgroup>
          <thead class="slds-text-title_caps ">
            <tr class="">
              <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d33959e340">User</th>
              <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d33959e343">User License</th>
              <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d33959e346">Permission Sets</th>
            </tr>
          </thead>
          <tbody>
            <tr class="">
              <td data-label="User" class="slds-cell-wrap" style="vertical-align:top;" headers="d33959e340 ">ServicePlanner User (agent user)</td>

              <td data-label="User License" class="slds-cell-wrap" style="vertical-align:top;" headers="d33959e343 ">Einstein Agent</td>

              <td data-label="Permission Sets" class="slds-cell-wrap" style="vertical-align:top;" headers="d33959e346 ">
                <ul>
                  <li>Agent Messaging Access custom permission set</li>

                  <li>Messaging Record Grounding custom permission set </li>

                </ul>
              </td>

            </tr>
            <tr class="">
              <td data-label="User" class="slds-cell-wrap" style="vertical-align:top;" headers="d33959e340 ">Service Rep</td>

              <td data-label="User License" class="slds-cell-wrap" style="vertical-align:top;" headers="d33959e343 ">Salesforce</td>

              <td data-label="Permission Sets" class="slds-cell-wrap" style="vertical-align:top;" headers="d33959e346 ">
                <ul>
                  <li>Prompt Template User permission set </li>

                  <li>Service Planner User permission set</li>

                  <li>Messaging Record Grounding Access permission set</li>

                </ul>
              </td>

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

## Test and Troubleshoot

Test your setup by starting a service plan on a messaging session and work through the plan reviewing the steps to verify related record information is present in the plan.

For example, if you added a custom field like Input:MessagingSession.EndUserAccount.LoyaltyStatus\_\_c to your prompt template for Account, the customer's loyalty status shows in plan steps along with other grounding field data.

![Service plan step showing related record grounding data](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/service_planner/sp_rrg_msg_example.png)

Another way to quickly confirm that Service Assistant captures the data is to ask for record information using the agent chat.

![Related record grounding testing using the agent chat](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/service_planner/sp_rrg_test_chat.png)

If Service Assistant can't access the data from the record, you'll see a message from Service Assistant in the form of "I can't assist you because there's no information in your company documents related to the provided context." Check that the object and field are included in your prompt template and that both Service Assistant and the service rep have access.

![Related record grounding data access message](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/service_planner/sp_rrg_test_data_access.png)

Service Assistant tracks any new information for your related record grounding fields. When new information is found in your grounding fields or you update the prompt template, Service Assistant captures the data and uses it as context to create the next plan step. Field or prompt template updates don't trigger Service Assistant to automatically regenerate the active plan step.

Keep in mind that not every step is grounded in or references the related-record data. Service Assistant reviews the grounded data in relation to the context of the active conversation. If the data isn't relevant to the conversation, the data isn't referenced in the plan steps.

If related record data isn't showing up in the plan steps, check the following.

- Confirm that the prompt template is active.
- Confirm that the Include Context from Related Records toggle is turned on from the Messaging tab of the Setup page.
- Confirm that the agent user and service reps have read access to all objects and fields included in the prompt template.
- If you have multiple Service Assistant for Messaging agents:
    - Confirm that all your agents are active.
    - Confirm that your agent assignment flow is active in Flow Builder and is selected in the Set Up Your Agent Assignment section of the Setup page.
    - Confirm that each agent has access to the objects and fields in your prompt template. All agents use the same prompt template, but you must grant access to each agent individually.