---
schema_version: "1"
id: 287814f6899d1b6ac308d02fb1a314d40c623a2ce7ab04224da5ffdb2fe0b54d
title: Get Default Values to Create a Record
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/uiapi/ui_api_resources_record_defaults_create.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_defaults_create.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5322ce3a6932649e1a81b32cc770370de57b12ecd42cc37f6c558bcf3319facd
description: Get the default values for fields for a new record of a specified object and optional record type. After getting the default values, make a request to POST /ui-api/records to create the record.
---
# Get Default Values to Create a Record

Get the default values for fields for a new record of a specified object and optional record type. After getting the default values, make a request to POST /ui-api/records to create the record.

The response contains the default field values for the Full layout type for a new record of the object type specified in {objectApiName}.

It also contains the corresponding layout for create mode. In the Salesforce user interface, an admin with “Customize Application” permission can mark a field as required in a layout. When you’re building UI, to determine which fields to mark as required in a layout for create mode, use the [RecordLayoutItem.required](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_record_layout_item.htm "An item in a record layout.") property.

The response contains object metadata for the object specified in {objectApiName} and for any nested objects. For example, this request returns object metadata for Account and User, because the OwnerId field on the Account object contains a reference to the User object.

/ui-api/record-defaults/create/Account

Resource

/ui-api/record-defaults/create/{objectApiName}

- objectApiName—The API name of the object type for the new record.

![Note](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/images/icon_note.png)

#### Note

To get default values with a more lightweight response, use the [/ui-api/record-defaults/template/create/{objectApiName}](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_defaults_template_create.htm "Get the default values for fields for a new record of a specified object and optional record type. You must specify the fields you want returned. This resource doesn’t use or return layout information. After getting the default values, make a request to POST /ui-api/records to create the record.") resource.

Available Version

41.0

HTTP Method

GET

Request Parameters

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





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

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

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

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

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

                </tr>

              </thead>

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

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

                  <td class="entry" headers="d69369e163" 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="d69369e166" data-title="Required or Optional">Optional</td>

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

                </tr>

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

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

                  <td class="entry" headers="d69369e163" 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="d69369e166" data-title="Required or Optional">Optional</td>

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

                </tr>

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

                  <td class="entry" headers="d69369e160" data-title="Type">Id</td>

                  <td class="entry" headers="d69369e163" data-title="Description">The ID of the record type (RecordType object) for the new record. If not
                    provided, the default record type is used.</td>

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

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

                </tr>

              </tbody>

            </table>

Response Body

[Record Defaults](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_responses_record_defaults.htm#ui_api_responses_record_defaults "The default information and data needed to create or clone a record. Use these values in a request to POST /ui-api/records.")

#### 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.")