---
schema_version: "1"
id: 38e774421a851fffde9e09d3c7179b16a9b2bc474e23b779349faf187afec520
title: Extract Data from Three Related Objects (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_extract_data_from_three_related_objects.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_extract_data_from_three_related_objects.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 9e051f83fae725d207bd282bda8e29ccd074615223f3fc2cbdf4725fe4dd6c72
description: For the managed package runtime, create an Omnistudio Data Mapper Extract for use by a Case-handling Omniscript. The agents who handle Cases can look up an Account, list all the Cases for the Account, and find the Contact for each Case.
products:
  - Omnistudio
release: "264"
---
# Extract Data from Three Related Objects (Managed Package)

For the managed package runtime, create an Omnistudio Data Mapper Extract for use by a Case-handling Omniscript. The agents who handle Cases can look up an Account, list all the Cases for the Account, and find the Contact for each Case.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note

In this example, it’s especially important to specify the complete object hierarchy in the **Extract Output Path**, filter, and **Extract JSON Path** values. Accounts and Contacts are directly related and related through Cases. This example uses the latter relationship. The object hierarchy tells the Data Mapper which relationship to use.

To download a data pack of this example for Omnistudio for Managed Packages, click [here](https://volt.my.salesforce.com/sfc/p/o0000000IKm8/a/3m000000nXVa/D8efjC6nv4zRtiBFlpDWowFbIxqKNWCkwwKOS0rN7jA).

To create this Data Mapper Extract:

1. Go the Data Mapper tab and click **New**. The Create dialog is displayed.
2. Specify a name for the Data Mapper and configure its settings:
    
    - **Interface Type** — Extract
    - **Input Type** — JSON
    - **Output Type** — JSON
3. Click **Save**. The Data Mapper Interface page is displayed.
4. On the Extract tab, add three extract steps:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d258136e134">
                  <p style="margin-bottom:0;">Object</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d258136e140">
                  <p style="margin-bottom:0;">Extract Output Path</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d258136e146">
                  <p style="margin-bottom:0;">Filter</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Object" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e134 ">
                  <p style="margin-bottom:0;">Account</p>
                </td>

                <td data-label="Extract Output Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e140 ">
                  <p style="margin-bottom:0;">Account</p>
                </td>

                <td data-label="Filter" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e146 ">
                  <p style="margin-bottom:0;">Id = AccountId</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Object" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e134 ">
                  <p style="margin-bottom:0;">Case</p>
                </td>

                <td data-label="Extract Output Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e140 ">
                  <p style="margin-bottom:0;">Account:Case</p>
                </td>

                <td data-label="Filter" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e146 ">
                  <p style="margin-bottom:0;">AccountId = Account:Id</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Object" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e134 ">
                  <p style="margin-bottom:0;">Contact</p>
                </td>

                <td data-label="Extract Output Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e140 ">
                  <p style="margin-bottom:0;">Account:Case:Contact</p>
                </td>

                <td data-label="Filter" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e146 ">
                  <p style="margin-bottom:0;">Id = Account:Case:ContactId</p>
                </td>

              </tr>
            </tbody>
          </table>
5. On the Output tab, map fields from the Extraction Step JSON to the Output JSON. To add a mapping, click the **+** button. Add four mappings:
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
            <colgroup>
              <col>
              <col>
            </colgroup>
            <thead class="slds-text-title_caps ">
              <tr class="">
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d258136e244">
                  <p style="margin-bottom:0;">Extract JSON Path</p>
                </th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d258136e250">
                  <p style="margin-bottom:0;">Output JSON Path</p>
                </th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Extract JSON Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e244 ">
                  <p style="margin-bottom:0;">Account:Name</p>
                </td>

                <td data-label="Output JSON Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e250 ">
                  <p style="margin-bottom:0;">Account:Name</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Extract JSON Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e244 ">
                  <p style="margin-bottom:0;">Account:Case:CaseNumber</p>
                </td>

                <td data-label="Output JSON Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e250 ">
                  <p style="margin-bottom:0;">Account:Case:CaseNumber</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Extract JSON Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e244 ">
                  <p style="margin-bottom:0;">Account:Case:Subject</p>
                </td>

                <td data-label="Output JSON Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e250 ">
                  <p style="margin-bottom:0;">Account:Case:Subject</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Extract JSON Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e244 ">
                  <p style="margin-bottom:0;">Account:Case:Contact:Name</p>
                </td>

                <td data-label="Output JSON Path" class="slds-cell-wrap" style="vertical-align:top;" headers="d258136e250 ">
                  <p style="margin-bottom:0;">Account:Case:Contact:Name</p>
                </td>

              </tr>
            </tbody>
          </table>
6. Verify that the structure displayed in the Current JSON Output panel looks like this:
    
    ```
    {
      "Account": {
        "Case": {
          "CaseNumber": "Text",
          "Contact": {
            "Name": "Text"
          },
          "Subject": "Text"
        },
        "Name": "Text"
      }
    }
    ```
    
    The order of fields in not important, but the structure is.
7. Go to the Preview tab. If you see an **Edit as Params** link, click it.
8. In the Input Parameters pane, specify a Key of `AccountId` and a Value of an Id such as `0015e000003XlkMAAS`.
9. Click **Execute**. Assuming the Account has associated Cases, the response looks like this:
    
    ```
    {
      "Account": {
        "Case": [
          {
            "Contact": {
              "Name": "Edward Stamos"
            },
            "Subject": "Cannot track our order",
            "CaseNumber": "00001004"
          },
          {
            "Contact": {
              "Name": "Leanne Tomlin"
            },
            "Subject": "Wrong size widgets",
            "CaseNumber": "00001003"
          },
          {
            "Contact": {
              "Name": "Jeff Hunt"
            },
            "Subject": "Update account phone number",
            "CaseNumber": "00001005"
          },
          {
            "Contact": {
              "Name": "Edward Stamos"
            },
            "Subject": "Billing status",
            "CaseNumber": "00001006"
          }
        ],
        "Name": "Acme"
      }
    }
    ```