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 This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see Omnistudio Help.

Note
Note

To download a data pack of this example for Omnistudio for Managed Packages, click here.

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:

    Object

    Extract Output Path

    Filter

    Account

    Account

    Id = AccountId

    Case

    Account:Case

    AccountId = Account:Id

    Contact

    Account:Case:Contact

    Id = Account:Case:ContactId

  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:

    Extract JSON Path

    Output JSON Path

    Account:Name

    Account:Name

    Account:Case:CaseNumber

    Account:Case:CaseNumber

    Account:Case:Subject

    Account:Case:Subject

    Account:Case:Contact:Name

    Account:Case:Contact:Name

  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"
      }
    }