---
isPublished: true
knowledgeIndex: false
hidden: true
noindex: true
template: "page.peb"
title: "Record Clone Action Flow Action"
description: "Clone a Salesforce record and optionally clone selected child records."
contentType: "reference"
audience: "admin,developer"
---

# Record Clone Action

Clone a Salesforce record and optionally clone selected child records.
The namespaced Apex action name is `rooms__RecordCloneAction`.
Check action availability and input fields in your installed package.

## Transaction summary

| Effect | Behavior |
| --- | --- |
| API callout | No API callout is made by the action. |
| Record writes | Inserts the cloned parent and selected children. A child-record DML failure can delete the newly created parent clone. |
| Queued work | No background job is explicitly started. |
| Email | No email is sent by the action. |

Leave Preserve ID false when inserting a new clone. Keeping the source ID can cause an insert error.
Related object names and parent lookup field names are comma-separated lists. Keep their positions aligned.
A false result can follow partial record processing. Inspect parent and child results before repeating the action.

## Inputs

**Required** describes the Flow input setting. The processing rules above also apply.

| API name | Flow label | Required | Default or guidance |
| --- | --- | --- | --- |
| `recordId` | SObject Record ID | Yes | Source Salesforce record ID. |
| `preserveId` | Preserve ID (default=False) | No | Default: `false`. Keep false for a new record insert. |
| `isDeepClone` | Deep clone (default=True) | No | Default: `true`. Controls copied record data; child inserts still require Related Records - Clone?. |
| `preserveReadonlyTimestamps` | Preserve Read Only Timestamps (default=False) | No | Default: `false`. Preserved read-only values can require additional permissions or cause save errors. |
| `preserveAutonumber` | Preserve Autonumber (default=False) | No | Default: `false`. Preserve only when the target object and permissions permit it. |
| `clonedRelatedRecords` | Related Records - Clone? (default=False) | No | Default: `false`. Set true to insert selected related child records. |
| `relatedSObject` | Related SObject(s) (Use comma separated list for multi) | No | Comma-separated child object API names. |
| `relatedSObjectField` | Related SObject Parent Field(s) | No | Comma-separated parent lookup API names, in the same order as child objects. |
| `relatedSObjectNullFields` | Related SObject Nullable Field(s) | No | Fields to clear on related child clones before insert. |
| `fieldMap` | Field Map Collection (field1=value1,field2=value2) | No | Comma-separated field overrides in `field1=value1,field2=value2` form. |

## Outputs

| API name | Flow label | Meaning |
| --- | --- | --- |
| `success` | Success | Whether the clone processing reported success. Inspect records after a false result. |
| `message` | Error message | Parent or child clone error details. |
| `recordId` | Input Record ID | The submitted source record ID. |
| `cloneId` | Output Clone Record ID | The new parent ID when assigned. Verify the record still exists after a child failure. |

## Configure the Flow

1. Select the source record and review the fields that must change on the clone.
2. Set clone options and optional field overrides.
3. For child cloning, supply matching object and lookup-field lists.
4. Store Success, Error message and Output Clone Record ID. Inspect the resulting records.

Review the Flow context, Apex action access and the object and field permissions needed by this operation.
Record writes can run other Salesforce automation.
For API work, also review the configured Salesforce API connection user's required access.

## Troubleshooting

**Parent insert fails.** Check validation rules, required fields, duplicate rules and Preserve ID.

**Child cloning fails.** Check matching child-object and parent-lookup lists. The new parent can be deleted after a child DML failure.

**A later callout fails.** The clone operation writes or deletes records in the calling Flow transaction.

See the [Flow action index](/content/build/flows/index.md) for transaction guidance and related actions.
