---
schema_version: "1"
id: c97badf413a56c16c1cc9e2d2e82e6cb4bbd3a0c87f0c7a64750211cd02f06dd
title: Get Default Values to Clone 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_clone.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_defaults_clone.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 374d604ec601bc9c55549614f6994b051dfd88cf458032195ad9eb97381a94c5
description: Get the default layout information, object information, and data for cloning a record. After getting the default values, make a request to POST /ui-api/records to create the record.
---
# Get Default Values to Clone a Record

Get the default layout information, object information, and data for cloning a record. 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 a record cloned from the record specified in {recordId}, optionally of the specified recordTypeId.

It also contains the corresponding layout information for edit 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 edit 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 type of the record specified in {recordId} and for any nested objects. For example, this request clones an Account record. It 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/clone/001d000000AtfRIAAZ

Resource

/ui-api/record-defaults/clone/{recordId}

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

#### Note

To get default values with a lightweight response, use the [/ui-api/record-defaults/template/clone/{recordId}](https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_record_defaults_template_clone.htm "Get the default values for fields for cloning a record. 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="d68677e146">Parameter Name</th>

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

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

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

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

                </tr>

              </thead>

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

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

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

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

                </tr>

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

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

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

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

                </tr>

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

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

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

                  <td class="entry" headers="d68677e158" 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.")