---
schema_version: "1"
id: 1ee88d039dfbb115b3bee710871dc94e9712d668f29e2fa158fd57d527a07d6d
title: Get Record Data and Object Metadata
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/uiapi/ui_api_resources_record_ui.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_ui.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 363c2d69c41d5c36887e0095b532d71619dad39ed471ab04e78f048917643b52
description: Get layout information, metadata, and data to build UI for a single record or for a collection of records.
---
# Get Record Data and Object Metadata

Get layout information, metadata, and data to build UI for a single record or for a collection of records.

The response contains layout information for whichever layout types are specified in the layoutTypes parameter.

It contains data for the records specified in the recordIds parameter.

The response contains object metadata for the object types of the records specified in the recordIds parameter, and for any nested objects. For example, a request to /ui-api/record-ui/001RM000003RsOHYA0, which is an Account, returns object metadata for Account and User, because the OwnerId field on the Account object contains a reference to the User object.

Resource

/ui-api/record-ui/{recordIds}

recordIds—A comma-delimited list of custom object records and [supported object](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_get_started_supported_objects.htm#ui_api_get_started_supported_objects "User Interface API supports all custom objects and external objects and many standard objects.") records.

Available Version

41.0

HTTP Method

GET

Example

The response for this request includes layout information, metadata, and record data. The record data includes child relationship data for Contacts and Opportunities.

GET /ui-api/record-ui/001R0000003I6CoIAK?childRelationships=Account.Contacts,Account.Opportunities

Request Parameters

<table class="featureTable sort_table" summary="">





              <thead class="thead sorted" align="left">
                <tr>
                  <th class="featureTableHeader vertical-align-top " id="d75373e138">Parameter Name</th>

                  <th class="featureTableHeader vertical-align-top " id="d75373e141">Type</th>

                  <th class="featureTableHeader vertical-align-top " id="d75373e144">Description</th>

                  <th class="featureTableHeader vertical-align-top " id="d75373e147">Required or Optional</th>

                  <th class="featureTableHeader vertical-align-top " id="d75373e150">Available Version</th>

                </tr>

              </thead>

              <tbody class="tbody">
                <tr>
                  <td class="entry" headers="d75373e138" data-title="Parameter Name"><samp class="codeph nolang">childRelationships</samp></td>

                  <td class="entry" headers="d75373e141" data-title="Type">String[]</td>

                  <td class="entry" headers="d75373e144" data-title="Description">A collection of child relationship names. The records with those child
                    relationship names are included in the response. Specify names in the format
                    <samp class="codeph nolang"><var class="keyword varname">ObjectApiName</var>.<var class="keyword varname">ChildRelationshipName</var></samp>
                    or <samp class="codeph nolang"><var class="keyword varname">ObjectApiName</var>.<var class="keyword varname">ChildRelationshipName</var>.<var class="keyword varname">FieldApiName</var></samp>.
                    For example, to specify the Contacts relationship on an Account, use <samp class="codeph nolang">Account.Contacts</samp>. You can get child
                    relationships one level deep.<p class="p">To get a relationship name, look in the <a class="xref" href="https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_object_info.htm#ui_api_responses_object_info" title="The metadata for an object.">Object Info</a> response body.</p>
                  </td>

                  <td class="entry" headers="d75373e147" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d75373e150" data-title="Available Version">41.0</td>

                </tr>

                <tr>
                  <td class="entry" headers="d75373e138" data-title="Parameter Name"><samp class="codeph nolang">formFactor</samp></td>

                  <td class="entry" headers="d75373e141" data-title="Type">String</td>

                  <td class="entry" headers="d75373e144" data-title="Description">The layout display size for the record. One of these values:<ul class="ul bulletList">
                      <li class="li">
                        <samp class="codeph nolang">Large</samp>—(Default) Use this value to
                        get a layout for desktop display size.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">Medium</samp>—Use this value to get a
                        layout for tablet display size.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">Small</samp>—Use this value to get a
                        layout for phone display size.
                      </li>

                    </ul>
                  </td>

                  <td class="entry" headers="d75373e147" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d75373e150" data-title="Available Version">41.0</td>

                </tr>

                <tr>
                  <td class="entry" headers="d75373e138" data-title="Parameter Name"><samp class="codeph nolang">layoutTypes</samp></td>

                  <td class="entry" headers="d75373e141" data-title="Type">String[]</td>

                  <td class="entry" headers="d75373e144" data-title="Description">The layout type for the record. A collection of any of these values:<ul class="ul bulletList">
                      <li class="li">
                        <samp class="codeph nolang">Compact</samp>—Use this value to get a
                        layout that contains a record’s key fields.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">Full</samp>—(Default) Use this value to
                        get a full layout.
                      </li>

                    </ul>
                  </td>

                  <td class="entry" headers="d75373e147" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d75373e150" data-title="Available Version">41.0</td>

                </tr>

                <tr>
                  <td class="entry" headers="d75373e138" data-title="Parameter Name"><samp class="codeph nolang">modes</samp></td>

                  <td class="entry" headers="d75373e141" data-title="Type">String[]</td>

                  <td class="entry" headers="d75373e144" data-title="Description">The access mode for the record. This value determines which fields to get
                    from a layout. Layouts have different fields for create, edit, and view modes.
                    For example, formula fields are rendered in view mode, but not in create mode
                    because they’re calculated at run time, like formulas in a spreadsheet. A
                    collection of any of these values:<ul class="ul bulletList">
                      <li class="li">
                        <samp class="codeph nolang">Create</samp>—Use this mode if you intend
                        to build UI that lets a user create a record. This mode is used by the
                        <samp class="codeph nolang">/ui-api/record-defaults/create/{apiName}</samp> resource.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">Edit</samp>—Use this mode if you intend to
                        build UI that lets a user edit a record. This mode is used by the <samp class="codeph nolang">/ui-api/record-defaults/clone/{recordId}</samp>
                        resource.
                      </li>

                      <li class="li">
                        <samp class="codeph nolang">View</samp>—(Default) Use this mode to
                        build UI that displays a record.
                      </li>

                    </ul>
                  </td>

                  <td class="entry" headers="d75373e147" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d75373e150" data-title="Available Version">41.0</td>

                </tr>

                <tr>
                  <td class="entry" headers="d75373e138" data-title="Parameter Name"><samp class="codeph nolang">optionalFields</samp></td>

                  <td class="entry" headers="d75373e141" data-title="Type">String[]</td>

                  <td class="entry" headers="d75373e144" data-title="Description">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. <p class="p">Specify names in the format <samp class="codeph nolang"><var class="keyword varname">ObjectApiName</var>.<var class="keyword varname">FieldName</var></samp>.
                      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.</p>
                  </td>

                  <td class="entry" headers="d75373e147" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d75373e150" data-title="Available Version">41.0</td>

                </tr>

                <tr>
                  <td class="entry" headers="d75373e138" data-title="Parameter Name"><samp class="codeph nolang">pageSize</samp></td>

                  <td class="entry" headers="d75373e141" data-title="Type">Integer</td>

                  <td class="entry" headers="d75373e144" data-title="Description">The maximum number of child records to return on a page.</td>

                  <td class="entry" headers="d75373e147" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d75373e150" data-title="Available Version">41.0</td>

                </tr>

                <tr>
                  <td class="entry" headers="d75373e138" data-title="Parameter Name"><samp class="codeph nolang">updateMru</samp></td>

                  <td class="entry" headers="d75373e141" data-title="Type">Boolean</td>

                  <td class="entry" headers="d75373e144" data-title="Description">To add to the most recently used (MRU) list view, set to <samp class="codeph nolang">true</samp>. The default value is <samp class="codeph nolang">false</samp>.</td>

                  <td class="entry" headers="d75373e147" data-title="Required or Optional">Optional</td>

                  <td class="entry" headers="d75373e150" data-title="Available Version">47.0</td>

                </tr>

              </tbody>

            </table>

Response Body

[Record UI](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_record_ui.htm#ui_api_responses_record_ui "The layout information, field information, and data for a record.")

#### See Also

- [User Interface API Quick Start](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_quick_start_postman.htm "Use the Postman desktop app or web-based UI to easily explore and test the UI API and other Salesforce APIs against your orgs.")
- [Object Info](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_object_info.htm "The metadata for an object.")
- [Get Child Records](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_features_records_child_relationships.htm "User Interface API has several resources that include child records in their responses. If a record has many child relationships, a response can be huge and have a negative effect on performance. To get only the records you need, request records for specific child relationships and set the page size of the results.")