Loading
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Relationship Notation versus Multiple Extract Steps

          Relationship Notation versus Multiple Extract Steps

          Using relationship notation improves the performance of Omnistudio Data Mappers that retrieve data from a parent of the primary object. Use this notation in the Extract JSON Paths for the parent object's fields instead of adding a second object in the Data Mapper's Extract tab.

          Relationship notation in Data Mappers is based on relationship queries in Salesforce. For more information about relationship names and other relevant topics, see Relationship Queries in Salesforce Help. You can use only child-to-parent relationship queries on Data Mappers.

          Suppose you want to retrieve Contact data that includes the name of the Account with which the Contact is associated, and the Account is a parent object of Contact. You can use multiple extract steps or relationship notation.

          To use multiple extract steps, first define extraction steps for Contact and Account objects on the Data Mapper's Extract tab. Then define Extract JSON paths for the Contact and Account fields.

          To use relationship notation, first define an extraction step for the Contact object on the Data Mapper's Extract tab. Then define Extract JSON paths for the Contact and Account fields.

          The Extract JSON Path for the Name field of the Account object is Account.Name. Account is the name of the relationship that the Contact object has with the parent Account object. The relationship name is different from the name of the field that references the parent object, which is AccountId. Most relationship names for standard objects follow this convention and omit the Id suffix.

          If you supply a Contact Id on the Preview tab, you get the same Response for that Contact for both Data Mappers:

          {
            "CompanyName": "Acme",
            "LastName": "Tomlin",
            "FirstName": "Leanne"
          }

          However, if you look in the Debug Log, you see two SOQL queries for the Data Mapper that uses multiple extract steps:

          SELECT id, accountid, firstname, lastname, name FROM Contact WHERE (Id = '0031U00000HUob9QAD')
          SELECT id, name FROM Account WHERE (Id = '0011U00000KbYZAQA3')
          

          You see only one SOQL query for the Data Mapper that uses relationship notation:

          SELECT id, firstname, lastname, account.name FROM Contact WHERE (Id = '0031U00000HUob9QAD')
          
          Important
          Important

          Running only one SOQL query per primary object is always noticeably faster than running two. A Data Mapper performs processing steps for each SOQL query that it runs, and Salesforce contributes overhead for each SOQL query as well. With one query rather than two, you have half the overhead.

           
          Loading
          Salesforce Help | Article