Handling Related Data in API Responses

Beginner

Retrieve parent and child records efficiently using portal data, related field references, and join-style multi-request patterns.

What you'll learn

  • How related fields (:: notation) appear in fieldData vs. portalData
  • How to control which portals and how many rows are returned
  • When to use _limit.portalName and _offset.portalName
  • Trade-offs between portal-based and multi-request approaches

The Data API returns a record's own field data plus portal rows for any portals on the layout. Related fields (using :: notation) also appear in fieldData if they are on the layout. Choosing the right strategy -- portals vs. related field references vs. multiple requests -- has a significant impact on response payload size and server load.

1/4
1

Related fields in fieldData

Fields from related table occurrences placed directly on the layout appear as "TO::FieldName" keys in fieldData. They return only the first related record's value unless the field is inside a portal.

JSON
// Layout has a related field Accounts::CompanyName placed on it
{
  "fieldData": {
    "FirstName": "Jane",
    "LastName": "Doe",
    "Accounts::CompanyName": "Acme Corp"
  }
}

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo