Newer Version Available
Get Child Records
Get child records for a specified record and
child relationship name. Relationships are connections between records. On a record detail page,
each record in a related list has a child relationship to the parent record.
- Resource
-
1/ui-api/records/${recordId}/child-relationships/${relationshipName} - recordId—The ID of the record for which you want to get child relationships.
- relationshipName—The name of the child relationship. This value is returned in the Object Info response body and is usually the plural form of the object name.
- Available Version
- 41.0
- HTTP Method
- GET
- Example
-
This example returns all the Contacts related to the Account record
001R0000003I6CoIAK.
1/ui-api/records/001R0000003I6CoIAK/child-relationships/Contacts -
The response is paginated. Use the pageSize parameter to specify the number of records per page. The default is
5.
1{ 2 "count" : 5, 3 "currentPageUrl" : 4 "/services/data/v41.0/ui-api/records/001R0000003I6CoIAK/child-relationships/Contacts?page=1&pageSize=5", 5 "nextPageUrl" : 6 "/services/data/v41.0/ui-api/records/001R0000003I6CoIAK/child-relationships/Contacts?page=2&pageSize=5", 7 "previousPageUrl" : null, 8 "records" : [ { 9 "apiName" : "Contact", 10 "childRelationships" : { }, 11 "fields" : { 12 "AccountId" : { 13 "displayValue" : null, 14 "value" : "001R0000003I6CoIAK" 15 }, 16 "Id" : { 17 "displayValue" : null, 18 "value" : "003R0000007qXwQIAU" 19 }, 20 "Name" : { 21 "displayValue" : null, 22 "value" : "John Smith" 23 } 24 }, 25 "id" : "003R0000007qXwQIAU", 26 "recordTypeId" : "012000000000000000", 27 "recordTypeInfo" : null 28 }, 29 ... 30} - Request Parameters
-
Parameter Name Type Description Required or Optional Available Version fields String[] Specifies the fields to return. If this property is specified, the response is a union of fields and optionalFields. If the context user doesn’t have access to a field, or if the field doesn’t exist, an error is returned.
If you’re not sure whether the context user has access to a field and you don’t want the request to fail if they don’t, use the optionalFields parameter.
Specify names in the format ObjectApiName.FieldName. You can get any field that has a named relationship to this record. There’s no limit to the number of fields you can specify.
Optional 41.0 optionalFields String[] A collection of optional field names. If a field is accessible to the context user, it’s included in the response. If a field isn’t accessible to the context user, it isn’t included in the response, but it doesn’t cause an error. Specify names in the format ObjectApiName.FieldName. You can get any field that has a named relationship to this record. There’s no limit to the number of fields you can specify.
Optional 41.0 page Int The page offset from which to begin returning records. The default value is 0, which returns records from the first page. For example, for page=2 and pageSize=10, the first record returned is the 21st record in the list. Optional 41.0 pageSize Int The maximum number of child records to return on a page. The default value is 5. Optional 41.0 pageToken String A token that represents the page offset. Optional 44.0 - Response Body
- Record Collection